Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distinct Count of Days

Status
Not open for further replies.

dannyb29

Technical User
Nov 10, 2010
90
GB
Hi All,
I am trying to work out how you distinct count the number of days between a date range. For example: 10/08/2011 00:00:00 to 12/08/2011 23:59:59 = 3 days.

Thanks x
dannyb
 
Do you mean you need the number of days within the range for which you have data?
 
Hi,

Within and including
10th
11th
12th
would equal 3 days

Many Thanks
 
One option is:
1. Right click the object
2. Select format Object.
3. Click Suppress if duplicated

Another option is:
1. creating a formula like this -
whilereadingrecords;
if not({DateRangefield} in date({?datetimeparameter})) then
(redim preserve date({?datetimeparameter}[ubound(date({?datetimeparameter})+1];
date({?datetimeparameter}[ubound(date({?datetimeparameter})]:= ({DateRangefield};);
""
2. Place it in the report header:

I've not tried them but I think they should work

____________________
Men put up a strong face just to cover their weaknesses...good!
But a smile makes them live longer....
Which would you choose?

Think about it.
 
Within and including 10th 11th 12th would equal 3 days"

@Days
{your endDate} - {your startdate}
 
{your endDate} - {your startdate}+1

Or:

datediff("d",startdate,enddate)+1

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top