cancel
Showing results for 
Search instead for 
Did you mean: 

Help Extracting Variable From Table

tradergonedev
New Contributor
I'm trying to extract the value of a table search to a variable. 

var: select sum quantity from table;

select statement returns a table.

I've tried exec:
var: exec sum quantity from table;

but it seems this gives me the type instead of value.

how would I go about stripping the value out so that I can use the variable downstream?

Thanks!
1 REPLY 1

TerryLynch
New Contributor II
Your issue might be that "var" is a reserved word. Use a different variable name. 

Then your exec statement should work - unless your table is splayed/partitioned on disk in which case you can't exec directly you need to

exec sum qty from select qty from table where date=


Terry