Howdy! I'm having problems finishing my sql. The problem lies in incorporating the DINE_1 and DINE_2 values. These variables values are posted to the asp page with the cusine values. I'm trying to say at the end of the SQL that if either or both DINE_1 & DINE_2 values are true to select the records where column eat has DINE_1 or DINE_2.
This is my SQL so far:
so far i have where eat db value = both, i'm trying to narrow down to records where DINE_1 and DINE_2 values sent to this asp page are true.
This is my SQL so far:
Code:
theSQL = "SELECT * FROM logbook WHERE cusine IN ("
AFRICAN = Request.Form("AFRICAN")
If AFRICAN = "true" Then
theSQL = theSQL & "'AFRICAN',"
End If
CARIBBEAN = Request.Form("CARIBBEAN")
If CARIBBEAN = "true" Then
theSQL = theSQL & "'CARIBBEAN',"
End If
CHINESE = Request.Form("CHINESE")
If CHINESE = "true" Then
theSQL = theSQL & "'CHINESE',"
End If
CONTINENTAL = Request.Form("CONTINENTAL")
If CONTINENTAL = "true" Then
theSQL = theSQL & "'CONTINENTAL',"
End If
DUTCH = Request.Form("DUTCH")
If DUTCH = "true" Then
theSQL = theSQL & "DUTCH',"
End If
EAST_INDIAN = Request.Form("EAST_INDIAN")
If EAST_INDIAN = "true" Then
theSQL = theSQL & "'EAST_INDIAN',"
End If
ENGLISH = Request.Form("ENGLISH")
If ENGLISH = "true" Then
theSQL = theSQL & "'ENGLISH',"
End If
ETHIOPIAN = Request.Form("ETHIOPIAN")
If ETHIOPIAN = "true" Then
theSQL = theSQL & "'ETHIOPIAN',"
End If
FONDUES = Request.Form("FONDUES")
If FONDUES = "true" Then
theSQL = theSQL & "'FONDUE',"
End If
FRENCH = Request.Form("FRENCH")
If FRENCH = "true" Then
theSQL = theSQL & "'FRENCH',"
End If
FUSION = Request.Form("FUSION")
If FUSION = "true" Then
theSQL = theSQL & "'FUSION',"
End If
GERMAN = Request.Form("GERMAN")
If GERMAN = "true" Then
theSQL = theSQL & "'GERMAN',"
End If
GREEK = Request.Form("GREEK")
If GREEK = "true" Then
theSQL = theSQL & "'GREEK',"
End If
ITALIAN = Request.Form("ITALIAN")
If ITALIAN = "true" Then
theSQL = theSQL & "'ITALIAN',"
End If
JAPANESE = Request.Form("JAPANESE")
If JAPANESE = "true" Then
theSQL = theSQL & "'JAPANESE',"
End If
JEWISH = Request.Form("JEWISH")
If JEWISH = "true" Then
theSQL = theSQL & "'JEWISH',"
End If
KOREAN = Request.Form("KOREAN")
If KOREAN = "true" Then
theSQL = theSQL & "'KOREAN',"
End If
MEDITERRANEAN = Request.Form("MEDITERRANEAN")
If MEDITERRANEAN = "true" Then
theSQL = theSQL & "'MEDITERRANEAN',"
End If
MEXICAN = Request.Form("MEXICAN")
If MEXICAN = "true" Then
theSQL = theSQL & "'MEXICAN',"
End If
MONGOLIAN = Request.Form("MONGOLIAN")
If MONGOLIAN = "true" Then
theSQL = theSQL & "'MONGOLIAN',"
End If
PAKISTANI = Request.Form("PAKISTANI")
If PAKISTANI = "true" Then
theSQL = theSQL & "'PAKISTANI',"
End If
PHILIPPINE = Request.Form("PHILIPPINE")
If PHILIPPINE = "true" Then
theSQL = theSQL & "'PHILIPPINE',"
End If
PIZZA = Request.Form("PIZZA")
If PIZZA = "true" Then
theSQL = theSQL & "'PIZZA',"
End If
PORTUGUESE = Request.Form("PORTUGUESE")
If PORTUGUESE = "true" Then
theSQL = theSQL & "'PORTUGUESE',"
End If
RIBS = Request.Form("RIBS")
If RIBS = "true" Then
theSQL = theSQL & "'RIBS',"
End If
STEAK_HOUSES = Request.Form("STEAK_HOUSES")
If STEAK_HOUSES = "true" Then
theSQL = theSQL & "'STEAK_HOUSES',"
End If
THAILAND = Request.Form("THAILAND")
If THAILAND = "true" Then
theSQL = theSQL & "'THAILAND',"
End If
UKRAINIAN = Request.Form("UKRAINIAN")
If UKRAINIAN = "true" Then
theSQL = theSQL & "'UKRAINIAN',"
End If
VEGETARIAN = Request.Form("VEGETARIAN")
If VEGETARIAN = "true" Then
theSQL = theSQL & "'VEGETARIAN',"
End If
VIETNAMESE = Request.Form("VIETNAMESE")
If VIETNAMESE = "true" Then
theSQL = theSQL & "'VIETNAMESE',"
End If
WEST_INDIAN = Request.Form("WEST_INDIAN")
If WEST_INDIAN = "true" Then
theSQL = theSQL & "'WEST_INDIAN'"
End If
theSQL = left( theSQL, len(theSQL)-1 )
theSQL = theSQL & ") AND eat IN ('BOTH')"
so far i have where eat db value = both, i'm trying to narrow down to records where DINE_1 and DINE_2 values sent to this asp page are true.