Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Ish
Starting Member
11 Posts |
Posted - 2010-07-26 : 13:02:15
|
Hi SELECT tblAppointment.appointmentId, tblAppointment.userId, tblAppointment.appointmentDate, tblAppointment.sTimeId, tblAppointment.note, tblAppointment.created, tblAppointment.createdByWHERE (tblAppointment.userId) = " & myStaffId _AND ((tblAppointment.appointmentDate) >= " & myStartDateUS _AND (tblAppointment.appointmentDate) <= " & myEndDateUS & ")"I have above query in my ASP page.myStaffId = 1myStartDateUS = '2010-7-26'myEndDateUS = '2010-7-31'I have table tblAppointment, column appointmentDate is define as datetime.I have many record in the table, but when I execute a this query, i am not get any result back.Please can some one help to sort this.many thanks |
|
Kristen
Test
22859 Posts |
Posted - 2010-07-26 : 13:13:21
|
Pass the date as yyyymmdd - no hyphens. Wrap it with single quotes. AND ((tblAppointment.appointmentDate) >= '" & myStartDateUS & "'"_AND (tblAppointment.appointmentDate) <= '" & myEndDateUS & "')" Does that fix it? |
 |
|
|
|
|