Phoenix00017
New member
- Local time
- Today, 13:18
- Joined
- Jul 8, 2003
- Messages
- 6
I'm trying to run a query with ASP.NET of my Access DB. So far all of my queries have worked fine - at least, until I tried using a date as one of my WHERE conditions. When I remove the date requirement in the code below, the query works fine. However, when I add the date back, it yields no results. I've tried making the variable "tempdate" a DateTime variable, a String, and a DateTime variable converted to a String. I give up...what am I doing wrong? (tempclassval is just an integer)
strSQLQuery = "SELECT TEquipmentList.Equipment as name, TEquipmentList.EquipmentID as id FROM TEquipmentList LEFT JOIN TSignOutTable ON TEquipmentList.EquipmentID = TSignOutTable.EquipmentID WHERE TSignOutTable.Date=" & CStr(tempdate) & " AND TSignOutTable.ClassID= " & tempclassval & ";"
Thanks for the help!
strSQLQuery = "SELECT TEquipmentList.Equipment as name, TEquipmentList.EquipmentID as id FROM TEquipmentList LEFT JOIN TSignOutTable ON TEquipmentList.EquipmentID = TSignOutTable.EquipmentID WHERE TSignOutTable.Date=" & CStr(tempdate) & " AND TSignOutTable.ClassID= " & tempclassval & ";"
Thanks for the help!