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 Chris 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 return a value from a SELECT SQL to a variable 1

Status
Not open for further replies.

Soundsmith

Programmer
Feb 21, 2001
84
US
Sorry, folks, here I go again!
In FoxPro, all I needed to do was say something like:

myVar=SELECT myField from MyTable WHERE keyfield=100

I'm trying to do a lot of background processing in a module (no form involved) and trying to avoid repeatedly creating recordsets just to get these single values.

Is there a simple, easy solution?

Thanks... David 'Dasher' Kempton
The Soundsmith
 
Use the DLookup command.

myvar = Dlookup([Field],<table>,&quot;where blahblahblah&quot;) Maq B-)
<insert witty signature here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top