Report from and to in header with a twist

B

Bill

Hi All,
I have the need for a from and to date in the header of the report
Fairly common.
But I am computing the start date for accuracy using DateAdd.
The report is always 14 days.
I am trying to format the date as "mmmm dd, yyyy
Here is the syntax I have tried
=DateAdd("d",-13,Format([EndDate],"mmmm dd"", ""yyyy")) & " - " &
Format([EndDate],"mmmm dd"", ""yyyy")
I get 10/1/05 - October 14, 2005
I wanted October 1, 2005 - October 14, 2005
Thanks for your assistance.
Bill
 
S

Steve Schapel

Bill,

Try it like this...
=Format(DateAdd("d",-13,[EndDate]),"mmmm dd"", ""yyyy") & " - " &
Format([EndDate],"mmmm dd"", ""yyyy")
 
M

Marshall Barton

Bill said:
Hi All,
I have the need for a from and to date in the header of the report
Fairly common.
But I am computing the start date for accuracy using DateAdd.
The report is always 14 days.
I am trying to format the date as "mmmm dd, yyyy
Here is the syntax I have tried
=DateAdd("d",-13,Format([EndDate],"mmmm dd"", ""yyyy")) & " - " &
Format([EndDate],"mmmm dd"", ""yyyy")
I get 10/1/05 - October 14, 2005
I wanted October 1, 2005 - October 14, 2005


You've got the functions backwards:

=Format(DateAdd("d",-13,[EndDate]), "mmmm dd"", ""yyyy") & "
- " & Format([EndDate],"mmmm dd"", ""yyyy")
 
B

Bill

Thanks Guys,
I don't know where my first Thank You went,
I apologize for not responding. Thanks, worked as both of you stated.
Bill
Marshall Barton said:
Bill said:
Hi All,
I have the need for a from and to date in the header of the report
Fairly common.
But I am computing the start date for accuracy using DateAdd.
The report is always 14 days.
I am trying to format the date as "mmmm dd, yyyy
Here is the syntax I have tried
=DateAdd("d",-13,Format([EndDate],"mmmm dd"", ""yyyy")) & " - " &
Format([EndDate],"mmmm dd"", ""yyyy")
I get 10/1/05 - October 14, 2005
I wanted October 1, 2005 - October 14, 2005


You've got the functions backwards:

=Format(DateAdd("d",-13,[EndDate]), "mmmm dd"", ""yyyy") & "
- " & Format([EndDate],"mmmm dd"", ""yyyy")
 

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