Date format in export query

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

Guest

I have a DateDue field and a TimeDue field. I lose the formatting when
exporting my query result.

I am selecting Microsoft Word Merge (*.txt.

The query looks fine with those the format property set to short date and h
ampm, respectively, but I get a full blown date/time for each. 01/31/2005
00:00:00 for DateDue and then a wierd 12/30/1899 10:00:00 for TimeDue.

How do I get the transferred output to display just 01/31/2005 for Date Due
and 10AM for TimeDue?

Thanks in advance your help!
 
Use the Format function on those fields in your query (do not just apply a
format to the field).
 
Thanks for responding, Doug. I tried that first and couldn't get it to work.
Would you reply with the specific syntax, please?

e.g. NewDate: Format([dateDue]...... or whatever.

Thanks!
 
NewDate: Format([dateDue], "mm/dd/yyyy")

or

NewDate: Format([dateDue], "Short Date")

NewTime: Format([timeDue], "hAM/PM")

Is there some reason why you've split the date and time? I've always found
it far easier to work with them when they're combined.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



KADL said:
Thanks for responding, Doug. I tried that first and couldn't get it to
work.
Would you reply with the specific syntax, please?

e.g. NewDate: Format([dateDue]...... or whatever.

Thanks!

Douglas J. Steele said:
Use the Format function on those fields in your query (do not just apply
a
format to the field).
 
I'm finally back at this!

How do you control data entry of date and time if they are not separated? I
only use the combined when it is a date/time stamp.

The delimited export of the time field looks great using NewTime:
Format([timeDue], "h AMPM")

However, NewDate: Format([dateDue], "mm/dd/yyyy") still gives me "2/17/2005
0:00:00" in the exported .txt file. It does look fine in the query. The same
is true using "Short Date".

This is bizarre!

Thanks for any further help you can give me.

Douglas J. Steele said:
NewDate: Format([dateDue], "mm/dd/yyyy")

or

NewDate: Format([dateDue], "Short Date")

NewTime: Format([timeDue], "hAM/PM")

Is there some reason why you've split the date and time? I've always found
it far easier to work with them when they're combined.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



KADL said:
Thanks for responding, Doug. I tried that first and couldn't get it to
work.
Would you reply with the specific syntax, please?

e.g. NewDate: Format([dateDue]...... or whatever.

Thanks!

Douglas J. Steele said:
Use the Format function on those fields in your query (do not just apply
a
format to the field).

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



I have a DateDue field and a TimeDue field. I lose the formatting when
exporting my query result.

I am selecting Microsoft Word Merge (*.txt.

The query looks fine with those the format property set to short date
and
h
ampm, respectively, but I get a full blown date/time for each.
01/31/2005
00:00:00 for DateDue and then a wierd 12/30/1899 10:00:00 for TimeDue.

How do I get the transferred output to display just 01/31/2005 for Date
Due
and 10AM for TimeDue?

Thanks in advance your help!
 
Nevermind the part of my reply cocerning formatting. I believe a schema.ini
file caused the problem because when I deleted it and re-ran the export, the
dates looked fine.

I guess I don't fully understand when and how the schema.ini file gets
created, because it didn't reappear, but my export file got created and it
looks great.

Douglas J. Steele said:
NewDate: Format([dateDue], "mm/dd/yyyy")

or

NewDate: Format([dateDue], "Short Date")

NewTime: Format([timeDue], "hAM/PM")

Is there some reason why you've split the date and time? I've always found
it far easier to work with them when they're combined.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



KADL said:
Thanks for responding, Doug. I tried that first and couldn't get it to
work.
Would you reply with the specific syntax, please?

e.g. NewDate: Format([dateDue]...... or whatever.

Thanks!

Douglas J. Steele said:
Use the Format function on those fields in your query (do not just apply
a
format to the field).

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



I have a DateDue field and a TimeDue field. I lose the formatting when
exporting my query result.

I am selecting Microsoft Word Merge (*.txt.

The query looks fine with those the format property set to short date
and
h
ampm, respectively, but I get a full blown date/time for each.
01/31/2005
00:00:00 for DateDue and then a wierd 12/30/1899 10:00:00 for TimeDue.

How do I get the transferred output to display just 01/31/2005 for Date
Due
and 10AM for TimeDue?

Thanks in advance your help!
 
Back
Top