Variables within SQL.REQUEST

  • Thread starter Thread starter Eliezer
  • Start date Start date
E

Eliezer

Hello... yesterday I posted a question regarding linking
access and excel, and I was told I can do it via
SQL.REQUEST. Everything works now, but one thing would
save me lots of grunt work. Is there a way to link excel
into the SQL request? For instance, my request looks like
this:

=SQL.REQUEST("DSN=CDAA", D8, 4, "Select ID,TIMEPT,CLEANED
FROM ALIFE WHERE (ID=1 AND TIMEPT=0)", FALSE)

Is there any way to get the variables "ALIFE", "ID",
and "TIMEPT" to be dependant upon valuse in an excel cell?
I tried this:

=SQL.REQUEST("DSN=CDAA", D8, 4, "Select ID,TIMEPT,CLEANED
FROM $B1 WHERE (ID=($C$3) AND TIMEPT=(D$5))", FALSE)

and it didn't work (it returned #N/A!). Thanks in advance!
 
Hi
try
=SQL.REQUEST("DSN=CDAA", D8, 4, "Select ID,TIMEPT,CLEANED FROM " & $B1
& " WHERE (ID=(" & $C$3 & ") AND TIMEPT=(" & D$5 & "))", FALSE)

HTH
Frank
 
Back
Top