Click to See Complete Forum and Search --> : select statement
piertiong
11-14-2003, 03:56 AM
may i know how to:
select *
from table
where variable = 1
AND variable = 2
meaning i want to select from a table where a variable can have 2 values.
simflex
11-17-2003, 07:37 AM
One thing you can do is to declare your variable and assign 2 values to it like:
dim var
var = rs("value1") & " " & rs("value2")
rs = select * from table where field ='"& var & "'
In this case, your values will be Hello and World.
I am not sure why you are doing it this way though.
It doesn't quite make a lot of sense.
piertiong
11-17-2003, 09:32 AM
i have found out:
SELECT *
FROM table
WHERE (column = 1 OR column = 2)
simflex
11-17-2003, 11:04 AM
meaning i want to select from a table where a variable can have 2 values
above statement is different from below statement
select* from tabke where column = 1 or 2