Date and Time to text

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

Guest

I am running a query to select specific data for export to a customer. They
require comma delimited format.

How do I change a date to a text? example:

10/2/2006 to "20061002"

Also Time to military text? example:

5:20PM to "1720"

Thanks
 
You would use the Format function.
For example:

Format("2006/12/31 12:30","yyyymmddhhmm")

would yield 200612311230

If you want just the time then it would be just "hhmm" as the second
parameter.
 
Use Format([YourFieldName], "yyyymmdd")
For time use Format([YourFieldName], "hhnn")

"m" is for month but "n" is for minutes.
 

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