Convert from vba to SQL (1 Viewer)

urobee

Registered User.
Local time
Today, 01:52
Joined
Aug 12, 2019
Messages
20
Hy,
I have a code that i wanted to use in a query instead of VBA.
Please help me to convert it because i always got syntax errors.

Code:
DLookup("[Name]", "[t_mst_Cells]", "ID = " & DLookup("[CellsID]", "[t_log_MeasLog]", "[ID]=" & TempVars("ID_Meas")))

Thank You Guys!
 

June7

AWF VIP
Local time
Yesterday, 16:52
Joined
Mar 9, 2014
Messages
5,423
I've never used TempVars but maybe:

SELECT * FROM [t_mst_Cells] WHERE ID IN (SELECT CellsID FROM [t_log_MeasLog] WHERE ID=TempVars("ID_Meas"))

Where is TempVars("ID_Meas") set?
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:52
Joined
Oct 29, 2018
Messages
21,358
Hi. Just in case that syntax doesn't work in SQL, you could try this one: TempVars!ID_Meas
 

Users who are viewing this thread

Top Bottom