VB041898
asked on
SQL Qestion
I would like to make an sql request (With an access databse) witch contain two compare operators. For example, i want the request to return only the records wtich contain the correct CustomerID AND the correct DateOrder. Following is the code i tried, but it doesn't work. Could anyone say me if it is possible to code it, and how do it ?
Dim MyDb as Database, ResultRequest as Recordset, CustID as Long
Set MyDb = OpenDatabase (MyDatabase)
Set ResultRequest = MyDb.OpenRecordset ( "Select * From [Order] " & "Where [OrderDate] = #" & Calendar1.value & "#" & "AND" & " [CustomerID] = #" & CustID & "#")
Where CustID come from another request of another table.
The system display me an error when trying to execute this code.
I hope someone know the correct answer.
Thank you in advance
BEST REGARDS
Dim MyDb as Database, ResultRequest as Recordset, CustID as Long
Set MyDb = OpenDatabase (MyDatabase)
Set ResultRequest = MyDb.OpenRecordset ( "Select * From [Order] " & "Where [OrderDate] = #" & Calendar1.value & "#" & "AND" & " [CustomerID] = #" & CustID & "#")
Where CustID come from another request of another table.
The system display me an error when trying to execute this code.
I hope someone know the correct answer.
Thank you in advance
BEST REGARDS
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
VB5's online help has most of it (It's Jet specific, but should get you started). Another good place to start is to use VisData (one of the sample apps that comes with VB5) to build your queries and statements. Access too has a very good Query builder. Other than that, your local library of bookshop should be able to point you in the right direction.
ASKER
Thank you for your answer
BEST REGARDS
BEST REGARDS
ASKER
Could you say me where can i find all different syntax for SQL, witch all diffrents type of data.
BEST REGARDS