SQL String (1 Viewer)

mark curtis

Registered User.
Local time
Today, 06:47
Joined
Oct 9, 2000
Messages
457
Hi Folks,

i am using the sql below but i am having a little syntax error:

i am trying to refer to a variable called strRAGCol


strSQL = "SELECT tblSite.SiteID, tblSite.SiteRAG, tblSite.Active " _
& " FROM tblSite " _
& " WHERE (((tblSite.Active)=Yes)AND((tblSite.SiteRAG)= strRAGCol));"

Any help much appreciated.

Mark
 

mark curtis

Registered User.
Local time
Today, 06:47
Joined
Oct 9, 2000
Messages
457
Hi Folks,

i am using the sql below but i am having a little syntax error:

i am trying to refer to a variable called strRAGCol


strSQL = "SELECT tblSite.SiteID, tblSite.SiteRAG, tblSite.Active " _
& " FROM tblSite " _
& " WHERE (((tblSite.Active)=Yes)AND((tblSite.SiteRAG)= strRAGCol));"

Any help much appreciated.

Mark
 

namliam

The Mailman - AWF VIP
Local time
Today, 07:47
Joined
Aug 11, 2003
Messages
11,695
mark curtis said:
strSQL = "SELECT tblSite.SiteID, tblSite.SiteRAG, tblSite.Active " _
& " FROM tblSite " _
& " WHERE (((tblSite.Active)=Yes)AND((tblSite.SiteRAG)= strRAGCol));"
Asking once is enough you know ?!

strSQL = "SELECT tblSite.SiteID, tblSite.SiteRAG, tblSite.Active " _
& " FROM tblSite " _
& " WHERE (((tblSite.Active)=Yes)AND((tblSite.SiteRAG)= '" & strRAGCol & "));"
 

ghudson

Registered User.
Local time
Today, 01:47
Joined
Jun 8, 2002
Messages
6,195
Then you have to take the strRAGCol out of the string ["quotes"].

strSQL = "SELECT tblSite.SiteID, tblSite.SiteRAG, tblSite.Active " _
& " FROM tblSite " _
& " WHERE (((tblSite.Active)=Yes)AND((tblSite.SiteRAG)= " & strRAGCol & "));"

Please delete your duplicate post.
 

Users who are viewing this thread

Top Bottom