MySQL Forums
Forum List  »  Microsoft Access

Time datatype from mysql appearing as date and time in access PTQ
Posted by: Avi Kauffmann
Date: April 05, 2010 10:08PM

Hi,

I wrote an SQL Union query that will return a list of time slots joined with appointments which will be sent to a combo box on an Access 2007 form, basically for a scheduling form. The time slots are stored as the Time datatype in mysql, but when the query is returned in access, it gets automatically formatted with today's date in front of the times. When I try to run the SQL query in my MySQL front end, it works fine, so I'm guessing it is an Access issue. I'm kind of stumped at the moment as I am still quite inexperienced with SQL and MySQL.

Here is the code:
SELECT tbltime_slots.Time_Slot, '' AS Name
FROM tbltime_slots
WHERE Surgery_Day = 18
UNION
SELECT TIME(tblschedule.Surgery_Time), CONCAT(Last_Name, ', ', First_Name)
FROM tblschedule LEFT JOIN tblpatients ON tblschedule.PatientID = tblpatients.PatientID
WHERE (((tblschedule.Surgery_Date)= 18)) and (((tblschedule.SurgeonID)=2));

OH and the WHERE parts are done by pulling values in VBA, these are just dummy values.

Thank you!
Avi

Options: ReplyQuote


Subject
Views
Written By
Posted
Time datatype from mysql appearing as date and time in access PTQ
4547
April 05, 2010 10:08PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.