syntax help

richard luft

Registered User.
Local time
Today, 06:03
Joined
Jun 4, 2004
Messages
63
HI; I'm trying to set up rst by means of SQL in code. Part of String is -Where rst.fieldname Like "9*" -. This parse works just fine in query widow, but doesn't compile. Any suggestions? TIA
 
If you are trying to do this with vba you need to set it up like

Dim criteria as string

criteria = "9*"

in the SQL part of the query you need to rewrite the WHERE part like so

Where rst.fieldname Like '" & criteria & "'

This is a (single quote) (double quote) & criteria & (double quote) (single quote)

If this is what you were looking for then I hope this helps.
 
thanx. just of note, I tried " Where rst.[fieldname] like '9*' (single qoute) and that did work. God knows why!
 

Users who are viewing this thread

Back
Top Bottom