Question Locked

How to link a MySQL table to Access and be able to see the time correctly

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a MySQL server that is used for recording time for payroll. I use Access for our HR database. I would like to be able to link/import the MySQL timesheet table and create reports with Access but when I do the times always show up as dates in the linked/imported table. The timesheet database is set to capture times as TIME type (00:00:00).

Any suggestion as how to go about linking/importing would be great and would probaby make my life easier if the HR department could run more reports without my intervention, currently I write PHP pages for everything coming out of the timesheet database.

Thanks for you time.

2 replies

by tony hopkinson

sort of non standard type when you are doing cross platform
If you are lucky , just setting a format on the column in access will fix it, note the data part of access's DateTime type will be garbage.

If not what ever automatic convert is happening is corrupting the data, so
casting/converting it to a string might work.
Then you could add another column and cast it in access.

Changing the type in MySQL to DateTime will definitely work, though you might get some problems with different base dates (DateTime =0)

Note Time in MySQL holds from -838:59:59 to 838:59:59 any values outside this range are clipped, also if you somehow manaage to put in an illegal value it get's stored with no error as 00:00:00.

There are some aspects of MySQL I find unbelievably stupid and this is one of them.

Hths

This discussion is closed to new replies.