Date format and Header information

G

Guest

I've created a database to track timecards and I've run across two issues I
can't find an answer to:

How do I change the date format without using the presets. We work in
yyyy/mm/dd; also on one report I need to display mmm/dd. Neither of these
options appears in the presets.

I've added a date range requirement to a query, when the report is run the
user is prompted "start date: mm/dd/yy" then "end date: mm/dd/yy" (see above
note on changing the date format). I would like the date range selected to
appear in the report header as "Pay Period: YYYY/MM/DD to YYYY/MM/DD".
Suggestions?

Thanks!
Pamala
 
R

ruralguy via AccessMonster.com

The Format() function accepts almost *any* user defined format.
Format([YourDate],"yyyy/mm/dd") OR Format([Yourdate],"mmm/dd")
 
F

fredg

I've created a database to track timecards and I've run across two issues I
can't find an answer to:

How do I change the date format without using the presets. We work in
yyyy/mm/dd; also on one report I need to display mmm/dd. Neither of these
options appears in the presets.

I've added a date range requirement to a query, when the report is run the
user is prompted "start date: mm/dd/yy" then "end date: mm/dd/yy" (see above
note on changing the date format). I would like the date range selected to
appear in the report header as "Pay Period: YYYY/MM/DD to YYYY/MM/DD".
Suggestions?

Thanks!
Pamala

In your query you must use the US date format of month/day/year (as
you already do) to enter the parameters.
However, you can display the date using your own format.
Add an unbound control to the report header.
Set it's control source to:

= "Pay Period: " & Format [start date: mm/dd/yy],"yyyy/mm/dd") & " to
" & Format [end date: mm/dd/yy],"yyyy/mm/dd")

The text within the brackets must be identical to the query bracketed
criteria text.
 
G

Guest

Thanks! I accidentally posted this request three times because the site told
me there was an error and the post wasn't posted, but it actually was.
Several people made the same suggestion as you, but you were the only one
that pointed out the need to make the text within the brackets identical - I
kept getting an error message until I read your post and realized that I
didn't have colons in the query text.

Thanks for the help!

Pamala

fredg said:
I've created a database to track timecards and I've run across two issues I
can't find an answer to:

How do I change the date format without using the presets. We work in
yyyy/mm/dd; also on one report I need to display mmm/dd. Neither of these
options appears in the presets.

I've added a date range requirement to a query, when the report is run the
user is prompted "start date: mm/dd/yy" then "end date: mm/dd/yy" (see above
note on changing the date format). I would like the date range selected to
appear in the report header as "Pay Period: YYYY/MM/DD to YYYY/MM/DD".
Suggestions?

Thanks!
Pamala

In your query you must use the US date format of month/day/year (as
you already do) to enter the parameters.
However, you can display the date using your own format.
Add an unbound control to the report header.
Set it's control source to:

= "Pay Period: " & Format [start date: mm/dd/yy],"yyyy/mm/dd") & " to
" & Format [end date: mm/dd/yy],"yyyy/mm/dd")

The text within the brackets must be identical to the query bracketed
criteria text.
 

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

Top