Assign results from a query to a variable

mafhobb

Registered User.
Local time
Today, 16:57
Joined
Feb 28, 2006
Messages
1,249
The query below returns one row of results which includes four different values:


SELECT TOP 1 SubCalls.SubCallID, Calls.CallID, Calls.ContactID, SubCalls.SubCallDate
FROM Calls INNER JOIN SubCalls ON Calls.CallID = SubCalls.CallID
GROUP BY SubCalls.SubCallID, Calls.CallID, Calls.ContactID, SubCalls.SubCallDate
HAVING (((Calls.ContactID)=[ID]))
ORDER BY SubCalls.SubCallDate;

How do I grab the "SubCallDate" and assign it to a variable (say Va1) so I can use it for other code later?

Thanks

mafhobb
 
Simplest is probably a DLookup:

Va1 = DLookup(...)
 
Yeap, that did it

DLookup("SubcallDate", "Stats Spec Customer First Date")

Thanks

Mafhobb
 

Users who are viewing this thread

Back
Top Bottom