How i select the hours only in date feild of yyyymmddhhmmss

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an application that returns a date/time feild in the format
yyyymmddhhmmss nubmber only string, i am looking for a query that will return
only the hh section. i am using access 2000 and am unable to get the
application to return a date in a more usable format.
 
I've used mid for this in the past.

For yyyymmddhhmmss

mid([FieldName],9,2)

will yield hh

9 is the starting character to extract
2 is the number of characters you want
 
I have an application that returns a date/time feild in the format
yyyymmddhhmmss nubmber only string, i am looking for a query that will return
only the hh section. i am using access 2000 and am unable to get the
application to return a date in a more usable format.

You can migrate this mess to a true Date/Time field with an
expression:

CDate(Format([datestring], "@@@@/@@/@@ @@:@@:@@"))

and then use the numerous Access date/time functions to extract
Hour(), Day(), Month() etc.

John W. Vinson[MVP]
 

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

Back
Top