Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Store query result into variable

Status
Not open for further replies.

WaveOut

Programmer
Sep 6, 2002
42
US
I'm executing the following query:

mysql = "local oilhours real;oilhours = 0;for(select * from aggregates where name = 'AA-FO-MFM' and period = 600 and avg > 15 and (ts > '01-jan-04' and ts < '01-feb-04') do oilhours = oilhours + 1;end;"


when I execute the above query .... oilhours = 36.6 which is correct. Now what I want to do is in my VBA code I want to assign the value of oilhours to the variable myoilhours. How is this done. I think it is going to require parameters but not sure.

Thanks,
David


 
how are you executing the query?

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top