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

Group Question - Is this Possible? 1

Status
Not open for further replies.

wld1957

Technical User
Feb 3, 2006
68
US
CRXI - Is it possible to have 1 value within a group return records based on a different date range. The data that is returned then adds the fees and subtracts what has been paid and shows a balance for all of the records returned (I already have this forumula done and working).
Sum ({cpmain.servicefee},{cpmain.court})-Sum ({cpmain.totjdgpaid},{cpmain.court})

I just need a different date range for the value of "JUV"

The field [cpmain.court] is in the group footer. I used 2 parameters to return the data.
1st - DETAIL OR SUMMARY SELECTION
2ND - DATE RANGE (TO AND FROM)

Is it possible to have one of the values in cpmain.court "JUV" return only data for a specified date range other than what is listed in the 2nd parameter and leave all others with the 1st parameter option.

Any ideas if this is possible would be greatly appreciated. Thanks in advance.

Bill

 
Is there a relationship between the 2nd parameter and the date for the JUV? In other words, can I add/subtract n days from the parameter to come up with the JUV date?
 
I had thought of something similar but could not figure it out. I need the date range of 01-01-08 to 12-31-08 for the value of "JUV", all of the other values go from 01-01-02 to 12-31-08.
Currently all of the values draw from the 2nd parameter, a start date and end date. I use [cpmain.recedate] for this parameter. What I do not know if it is possible to have a different date for one of the value's within the group.
 
It's not clear where you're using the parameters, but what you can do is set up formulas and use them in place of the parameters.

@StartDate
(if {cpmain.court} = "JUV" then <juv start date> ELSE MINIMUM({?daterange}))

@EndDate
Maximum({?daterange})
 
You would have to create conditional formulas for each part of the formula, i.e.,

//{@JUVsvcfee}:
if {table.value} = "JUV" and
year({table.date}) = 2008 then
{cpmain.servicefee}

//{@JUVtotjdgpd}
if {table.value} = "JUV" and
year({table.date}) = 2008 then
{cpmain.totjdgpaid}

Then create a formula:
Sum ({@JUVsvcfee},{cpmain.court})-Sum ({@JUVtotjdgpd},{cpmain.court})

This would work as long as the daterange for JUV always fell within the daterange used as the record selection criterion.

-LB
 
The only criteria for this report is the date range.
In Select Criteria:
cpmain.recedate = (daterange) parameter
I have tried both ideas and I'm still having trouble. I tried the following:
//{@JUVfee}:
//if {cpmain.cpmainid} = "JUV" and
//year({cpmain.recedate}) = 2008 then
//{cpmain.servicefee}

//{@JUVpaid}
//if {cpmain.court} = "JUV" and
//year({cpmain.recedate}) = 2008 then
//{cpmain.totjdgpaid}

//Then create a formula:
Sum ({@JUVfee},{cpmain.court})-Sum ({@JUVPaid},{cpmain.court})

I then put it in with the balance formula, but that did not work. I also tried to write a formula within the select critera but did not have any luck.
If {cpmain.court} = "JUV" THEN {@JuvBalance} ELSE
Sum ({cpmain.servicefee}, {cpmain.court})-Sum ({cpmain.totjdgpaid}, {cpmain.court})

I basically need the {cpmain.court} = "JUV" to pull records for only 2008 and all others to pull from the date range if possible.

 
Use:

If {cpmain.court} = "JUV" THEN
Sum ({@JUVfee},{cpmain.court})-Sum ({@JUVPaid},{cpmain.court}) ELSE
Sum ({cpmain.servicefee}, {cpmain.court})-Sum ({cpmain.totjdgpaid}, {cpmain.court})

-LB
 
Thanks, it now works, had to have coffee this morning before getting started.

Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top