Total Days in a Parameter

rkrause

Registered User.
Local time
Today, 02:00
Joined
Sep 7, 2007
Messages
343
When a desired user is running a report they get 2 pop up boxes for a date range. Is there a way to figure out how many days are in that range. example if they put 2-1-09 and 2-28-09 thats 28 days. I want a seperate Txt box to display the total days. So for this month my textbox would display 28. Please help thank.
 
Look up the DateDiff() function in the help file.

Bob

P.S. To show inclusive dates you'll need to add 1 day to the result since datediff("d", #2/1/09#, #2/28/09#) will return 27, not 28.
 
Last edited:
=datediff(d,[Enter a Start Date],[Enter an Ending Date])

Thats what i tried using. But i got an error, and it prompted me for another parameter. The dates in Brackets are my parameters that i use when the report is being run.
 
You'll need to use quotes, e.g. "d" versus d.

Bob
 
I didnt see your PS on the bottom I got it. THanks alot!!!
 
I guess i have another question. For the dates, how do i use the parameters that i use. I am not always going to run this report for just February.
 
You need to create a calculated field in your query, e.g.:

MyTot: datediff("d",[Enter a Start Date],[Enter an Ending Date]) + 1

The above has nothing to do with February in particular, but instead is dependent on your Start and End Dates.

You really need to take a look at the Help File and the accompanying example(s).

Bob
 

Users who are viewing this thread

Back
Top Bottom