dynamically create sql string

spinkung

Registered User.
Local time
Today, 11:17
Joined
Dec 4, 2006
Messages
267
Hi all,

I'm trying to create a sql string which i want to use mre than once by using values from arrays.

i have this...
Code:
sql = "select * from [COLOR="Red"]'" & query_name(iQuery) & "'[/COLOR] " & _
"where courier = '" & Courier(iCourier) & "' " & _
"and [Claim Type] in (""" & claim_type(iClaim_Type) & """) "

...It's getting stuck on the highlighted part where i'm trying to pass in a query name. All i'm getting is a type mismatch error. It seems to work with the others params though???

Anyone?

Thanks,
Spin.
 
try

Code:
sql = "select * from " & query_name(iQuery) & _
"where courier = '" & Courier(iCourier) & "' " & _
"and [Claim Type] in (""" & claim_type(iClaim_Type) & """) "
 
perfect, thanks whoot.
 

Users who are viewing this thread

Back
Top Bottom