views:

44

answers:

2

In access i used this and its works fine:

(tblReservations_Dates.Date) Between #" & dteBegDate & "# And #" & dteEndDate & "#

Using MySQL I used this:

(tblReservations_Dates.Date) Between '" & dteBegDate & "' And '" & dteEndDate & "'

However the data is not displayed I was just wondering if this is the correct syntax for SQL Statement for comparing dates?

A: 

You need to make certain that the date strings (dteBegDate and dteEndDate) are in the format expected by MySQL, which would be YYYY-MM-DD HH:MM:SS. So, right now would be

2009-11-25 21:45:52

(in Pacific time). Other than that, it should work fine.

Michael Todd
+1  A: 
  1. You don't need the brackets around the table.column reference
  2. You need to make sure the query is submitting the start & end values in the proper datattype - date in this case.

Use STR_TO_DATE to safely convert whatever you're providing into a date datatype for MySQL. If you provide the date format, I'd be happy to update my answer with an example.

OMG Ponies