Date Functions

J

JMS

Greetings.

I have a report that requires a date function that I need help with. If I
run the report in February for transactions done from 01-01-08 through
01-31-08 I need to be able to show the January date range on the report. I
run the actual January report February 1st through the 20th of every month,
the report however has to show the previous months beginning and start days.
I hope this makes sense.

Thanks,
Jason
 
D

Duane Hookom

I would think you could use similar expressions to what you are using to
filter the report. Otherwise last months dates are:
StartOfLastMonth: DateSerial(Year(Date()), Month(Date())-1, 1)
EndOfLastMonth: DateSerial(Year(Date()), Month(Date()), 0)
You can add these as columns in your report's record source or use the
expressions in a control source.
 
J

JMS

Duane,

On the report I am using, is there was a way to add the leading 0 to single
digit dates. Because this particular for has a certain protocol for dates,
is there also a way to remove the slashes. (02012008 instead of 2/1/2008)
Thanks in advance.

Jason
 
D

Duane Hookom

You should be able to format any date expression like:
Format([date expression],"mmddyyyy")
 
J

JMS

Thanks again.

Duane Hookom said:
You should be able to format any date expression like:
Format([date expression],"mmddyyyy")

--
Duane Hookom
Microsoft Access MVP


JMS said:
Duane,

On the report I am using, is there was a way to add the leading 0 to
single
digit dates. Because this particular for has a certain protocol for
dates,
is there also a way to remove the slashes. (02012008 instead of 2/1/2008)
Thanks in advance.

Jason
 

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