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

Select records by date 1

Status
Not open for further replies.

Brian555

Technical User
Apr 29, 2005
20
GB
Can anybody help?
I am trying to select a group of records by date and count the result. See example table below.

DATE FRUIT
10/01/2004 apple
14/02/2004 pear
24/02/2004 pear
01/01/2005 orange
09/03/2005 apple
20/06/2006 pear

I have created a Parameter (dateselect) to select the date range.

The formula I am using to select the records (recordselect) is:
If Date({DATE}) in {dateselect} then { FRUIT}

The formula I am using to count the records is:
Count ({@recordselect})

The problem is that whatever date range I select the count always returns a count of all the records.
 
The count of a formula is the number of times it executes. If you insert a group on {table.fruit}, then you could create a formula like:

if {table.date} in {?daterange} then 1

Then you could right click on this formula and insert a SUM, not count, at the group level and/or at the report level.

You could also eliminate this problem if you were able to use the daterange in the record selection formula so that only the relevant records were returned.

-LB
 
lbass

Sincere thanks for your suggestion, it has resolved my problem.

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top