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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to assign SQL query resluts to a variable

Status
Not open for further replies.

beetlebailey

Programmer
Jan 4, 2005
51
US
I have a simple Excel VBA query as follows:

SQL="Select Hour1 from vpd where line=502"

Now how do get the results of Hour1 assigned to a variable H

This seems simple enough but I am having a rough time of it.

Thanks in advance, Mark
 
not sure this is the right forum for this....

if you were using a sql server db then you'd do this

Code:
declare @hr as int;
select @hr = Hour1 from vpd where line=502

"...we both know I'm training to become a cagefighter...see what happens if you try 'n hit me..."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top