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!

Putting a Count Formula before a parameter

Status
Not open for further replies.

Viscount

IS-IT--Management
Oct 10, 2003
85
GB
Hello...

I have got a CR9 report that has a user parameter for the date. This is fine.

I also want to know if the record is the first entry or a followup entry for that ID.

To do this I have created a formula field

IF (Count ({Table.sequence}))>1 then "F/U" else "New"

This works grand - for the day that the user puts in. I want it to work for all the records for that ID, regardless of which date is requested.

I would imagine that this is simple - but bear with me.

Thanks.
 
The date parm seems pointless if you're looking at all rows, as you say "I want it to work for all the records for that ID, regardless of which date is requested.
". Where are you using this parm?

This may be simple, but please provide example data and expected output, text descriptions generally do little more than allow for the start of a discovery process.

To get fast results, post Crystal version, database type and version, example data and expected output.

-k
 
Thanks - I am using CR 9 Professional with SQL DBase

There are 2 tables linked on ID. The ID and Name Fields are in one Table and the Date field is in the other.

Example Data

ID Name Date

1234 A Blogs 01/02/2003
4321 A Smith 01/03/2003
4321 A Smith 01/04/2003
5432 A Other 01/04/2003


Expected Data

User Set Date Parameter: 01/04/2003

ID Name Date New or Follow Up

4321 A Smith 01/04/2003 F/U
5432 A Other 01/04/2003 New


As I said above the New or Follow Up is a Formula field using the following formula:

IF (Count ({Table.sequence}))>1 then "F/U" else "New"

What I want to do is set it so that firstly it looks to the date field to see if the Client is new or a follow up and then return the appointments for a gien date (The User set parameter)

I hope that this helps.

Vis
 
Your formula is fine. providing you limit the rows in the databse to that date or before:

Report->Edit Selection Formula->Record:

{table.date} <= {DateParm}

Now you'll only get rows which were generated on or before that date, so your formula will work.

Right click the details section and select format section->X 2 next to suppress and use:

{table.date} <> {DateParm}

This will suppress all rows which are not for the date.

Hope this resolves.

-k
 
Thanks K.

I think that I have got it all sorted now.

vis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top