Managing Hours and Minutes (1 Viewer)

roosn

Registered User.
Local time
Today, 13:39
Joined
Jul 29, 2005
Messages
121
Hi
I have Access front end database on a SQL server back end.
I have come up with a problem, that i just cannot resolve despite the help pages or searching.
i wish to log the time of day of an event on a record, in 24 hour format (00:00), simple as that.
Then to link the table thru to the front end database and then be able to edit / update the time in the front end on a form.
currently i have the record in sql server table as a smalldatetime datatype and short time format. all is well.
when i go to access and link the table to the front end, no matter what i do the record shows as 01/01/1900 23:59:00 format rendering it uneditable.
Would somebody be so kind as to point in the right direction or advise me where i am going wrong.
Many Thanks
Roos
 

stopher

AWF VIP
Local time
Today, 13:39
Joined
Feb 1, 2006
Messages
2,395
My knowledge of SQL Server is limited. But I would guess you should be able to use the TimeValue function to convert to an Access Date/Time.

I would have thought there is a more appropriate way of managing time from SQL Server to Access so hopefully my post will prompt an expert. Have you done a search of the forums as I reckon someone will have covered this.

As I understand, SQL Server stores date and time as two integers (one for days since 1st Jan 1900 and one for number milliseconds into the day) put together and stored as a single integer. Access stores date/time as a double (the decimal part representing the time). I guess it's just a case on converting one to the other but I'm just guessing i.e strip of the time element of the SQL integer and convert this to a decimal part of the day.

Chris
 

roosn

Registered User.
Local time
Today, 13:39
Joined
Jul 29, 2005
Messages
121
Thanks Chris
i managed to solve it, with a bit of reading.
Just manage the formatting of the sql table field in access, and it seems to work.
regards
roos
 

Users who are viewing this thread

Top Bottom