Convert unix time to date/time in Access 2003 for a linked tabel

K

Kevin Joyce

Along time age I had a database that I used to access that used linked
tables and I was able to convert the the unix time value to a date/time
format but since upgrading to Access 2003 I have not been able to do this.

Can anyone provide some assistance?

Thanks.
 
K

Kevin Joyce

Hi Douglas,

I am connecting to a MySQL database. The field I am trying to convert is
called dtime it is in seconds since 1/1/1970. I am using:

DateAdd("s", [dtime], #1/1/1970 5:00:00#)

It is still reporting it in seconds when I execute my query.

Thanks.
 
D

Douglas J. Steele

That looks as though it should work. What are you doing with the resultant
field?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Kevin Joyce said:
Hi Douglas,

I am connecting to a MySQL database. The field I am trying to convert is
called dtime it is in seconds since 1/1/1970. I am using:

DateAdd("s", [dtime], #1/1/1970 5:00:00#)

It is still reporting it in seconds when I execute my query.

Thanks.

Douglas J. Steele said:
How are you trying to convert the time? What happens when you try?
 
J

John Nurick

As Doug says, that looks as if it should work - but it returns a date
serial number, not a string representation of a date (though VBA often
displays it as the latter). Are you sure it's giving you a Unix date in
seconds as opposed to an Access one in days?

Hi Douglas,

I am connecting to a MySQL database. The field I am trying to convert is
called dtime it is in seconds since 1/1/1970. I am using:

DateAdd("s", [dtime], #1/1/1970 5:00:00#)

It is still reporting it in seconds when I execute my query.

Thanks.

Douglas J. Steele said:
How are you trying to convert the time? What happens when you try?
 
Joined
Oct 7, 2008
Messages
1
Reaction score
0
I used DataAdd as illustrated in Kevin's post. I am also using Access 2003. To get it to work, I had to drop the 5:00:00. Once I did that, it worked fine. Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top