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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateDiff day results

Status
Not open for further replies.

AssetRecovery

Programmer
Sep 17, 2003
14
US
I have a formula that calculates how long a support ticket has been in the queue based on the date created. I am returning the results using the "d" for day. My results are returning with:
1 Day
2 to 6 Days
7 to 30 Days
>31 Days
Current Day

Question: Do I have any control over these result ranges? Say I want to show 2 to 5 Days or 10 to 20 days or even combine current day with 1 day so it's a 48 hour period instead of a 24 hour period?
 
You could do this with a number range parameter {?#days} that allows multiple values (or discrete values if you only want one range). The user would then enter the minimum and maximum value for each range they wanted to view.

If you wanted to use the parameter as a record select, you could use:

datediff("d",{table.date},currentdate) = {?#days}

If you want to then group by the ranges selected, create a formula {@#days}:

if datediff("d",{table.date},currentdate) = {?#days}[1] then totext(minimum({?#days}[1]),0)+" to "+ totext(maximum({?#days}[1]),0) else
if datediff("d",{table.date},currentdate) = {?#days}[2] then totext(minimum({?#days}[2]),0)+" to "+ totext(maximum({?#days}[2]),0) //add clauses up to the number of ranges that might be entered

Then insert a group on this formula.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top