Got SELECT & FROM but need WHERE!

WebFusion
11-08-2004, 12:32 AM
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.

Flyguy
11-08-2004, 12:35 AM
Dim sSQL As String
sSQL = "SELECT fld6 FROM main WHERE fld2 = ""Apples"" ORDER BY fld6"

WebFusion
11-08-2004, 12:43 AM
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