Got SELECT & FROM but need WHERE!

11-07-2004, 11:32 PM
The following code pulls all records from fld6
"SELECT fld6 FROM main ORDER BY fld6"

But I want to query it so that it only selects certain data from fld6 based on fld2, so if fld2 contains let's say the word Apples then the query is:

SELECT fld6 FROM main WHERE fld2 = Apples ORDER BY fld6

Now the exact code above does not work but I am trying to find what syntax I am missing.

11-07-2004, 11:35 PM
Dim sSQL As String
sSQL = "SELECT fld6 FROM main WHERE fld2 = ""Apples"" ORDER BY fld6"

11-07-2004, 11:43 PM
Hey thanks Flyguy, I feel like an idiot now (I see I only really missed a set of quotes) Thx for a fast reply, now I can go to bed under the Vegas sun.

Actually it's night right now, and it's raining, that's right it does rain in Las Vegas........ about 2 days per year, but it rains!! ;-)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum