-
Hi all
I'm trying to select specific data from an Access database but I'm having trouble when using the Access 'date\time' type with the 'date' type in SQL.
This is my code below. FlightDate and FlightTime are VB Date types, Bookings.Date and FlightNumbers.Departure are Date/Time type.
AND (Bookings.Date = '""# & FlightDate & #""')
AND (Flight Numbers.Departure Time = '" & FlightTime & "' );
The error I receive is "Data type mismatch in criteria expression"
Can anyone help me? Pleeeease....
-
Hi Romper. I might be wrong but I think your problem is that you have got the date inclosed in Single pips and the # sign, try just using the # sign instead.
"AND (Bookings.Date = '"# & FlightDate & "#)" & _
" AND (Flight Numbers.Departure Time = " & FlightTime & ")"
Hope This Helps
Ian
-
I think you also have to use the format mm/dd/yy, it will not except European dd/mm/yy or any other format.