Re: Timestamps



scstrachan@xxxxxxxxx wrote:
Does anyone know how to pull the date and the time from a timestamp
field in msaccess? Here is an example.

8/30/2007 11:53:00 AM

Ultimately, I would like to be able to place the date in one field and
the time in another. i would then like to be able to sort the time.
Any help would be appreciated.

Thanks,
Scott

Here's an example. Using format, the value is a string. Cdate converts it back to a date field.
? dt
8/31/2007 7:06:12 AM
dt = Now()
? format(dt,"mm/dd/yyyy")
08/31/2007
? format(dt,"hh:nn:ss")
07:06:55
? cdate(format(dt,"mm/dd/yyyy"))
8/31/2007
? cdate(format(dt,"hh:nn:ss"))
7:06:55 AM
.



Relevant Pages

  • Re: dateTime Manupulations
    ... datetime conversion between strings, however it was a datetime conversion ... between a datetime value and a string value. ... tell that for conversion between a string and a date a CDate is not the best ... > converting a DateTime with a specific format is one of those exceptions. ...
    (microsoft.public.dotnet.languages.vb)
  • RE: Excel VBA vs Time fields
    ... CDate can convert times entered as strings if they are in the correct format ... with the colon and the string contains hours. ... and cannot handle hours exceeding 24. ...
    (microsoft.public.excel.programming)
  • Re: how to get actual date format
    ... Not sure what you mean by "that can be used with the cDate() or isDate() functions" ... Both of these functions accept string expressions that represent dates and can ... Now, if you are trying to determine the format of the short date regional setting, ...
    (microsoft.public.vb.general.discussion)
  • Re: Thread: Date and Time
    ... In VB.NET you can use CDate instead of DateTime.Parse. ... DateTime.Parse is useful to convert a string to a DateTime based ... You can use the DateTime.ToString to format a date in a specific ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Thread: Date and Time
    ... In VB.NET you can use CDate instead of DateTime.Parse. ... DateTime.Parse is useful to convert a string to a DateTime based ... You can use the DateTime.ToString to format a date in a specific ...
    (microsoft.public.dotnet.languages.csharp)