Format of a time in a textbox when it is being edited

  • Thread starter Thread starter Daryl
  • Start date Start date
D

Daryl

Hi all
I am trying to edit a time in a textbox, the time is displayed in
(ShortTime - 8:35) but when I go to edit it reverts to (30/12/1899 8:35:00
AM).

Are they any work arounds to keep the 8:35 displayed when editing?

BTW - SQL Server 2000 is being used with the datatype datetime.

thanks
daryl
NOTE - This message was posted at the ACCESS.ADP.SQLSERVER group, no
responses
 
I don't believe there's any way around it.

For one thing, the Date data type in Access really isn't intended to store
just a time: it's meant to hold a timestamp (date and time). That's because
under the covers, Access is storing it as an 8 byte floating point number,
where the integer portion represents the date as the number of days relative
to 30 Dec, 1899, and the decimal portion represents the time as a fraction
of a day. As you've noticed, when you have only a time, the integer part is
0, so Access assumes it's a time on 30 Dec, 1899.
 
Thank you for answering this for me Doug, it is what I suspected but did not
really want to hear.


The interesting thing is that I converted a table from Access 2000 to SQL
Server 2000 using datetime as the datatype (the default smalldatetime did
not work) and it is strange that for some of the times the (ShortTime)
Access format works, but for other it does not. There does not seem to be a
pattern though, still thinking about it.

Now, JET worked for all times - why this is? I don't know.

Is there any other places (web sites, books etc) that perhaps I could get
advice on the strange behaviour of why some times edit as expected i.e. 8:35
and other expand out when being edited? Perhaps it is an Access bug with
ADPs.

I think that Access Data Projects (ADP) are very good, they provide a happy
medium between Access and the transition to Client Server (SQL Server and
use of ADO/VB) that can be easily developed and you get to use your Access
knowledge for form and report development.


thanks
daryl
 
Back
Top