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!

Selection criteria formula to determine (current date - 8) 2

Status
Not open for further replies.

TimothyP

Programmer
Aug 6, 2002
135
US
I am trying to create a selection criteria formula to select records where the most current date for a group of records is less then 8 days old. Any suggestions?

Thanks in advance for your assistance.

Tim
 
If you want all the group records (including those older than 8 days) as long as the most recent one is within the last 8 days, then go to report->edit selection formula->GROUP and enter:

maximum({table.date},{table.group}) > currentdate - 8

-LB
 
Try this in your Group selection formula

Maximum({table.date},{groupid}) >= currentdate - 8

The {groupid} is the field you are using for your grouping.

Cheers,

-LW
 
Actually, I only want to display the records where the current date is less then 8 days old.

Thanks,
Tim
 
Then

{table.date} > currentdate - 8

Cheers,
-LW
 
My apologies for being vague in my original post.
Let me try to be more specific.

I have a table that looks something like this:

Ticket# Change Type Change Date
1 A 01/31/2005
1 A 01/15/2005
1 B 02/01/2005
1 C 12/15/2004
2 A 01/31/2004
2 A 12/01/2004
3 A 12/05/2004
3 C 02/01/2005
3 C 01/31/2005
4 B 01/31/2005
4 B 12/07/2004
5 B 11/01/2004
5 A 02/01/2005
5 A 01/31/2005

I want to create a report that is grouped by Change Type that only displays the records when the MAXIMUM (Change Date) for a Ticket# is > currentdate – 8.

My report should look like this:

Group A
Ticket# Change Type Change Date
1 A 01/31/2005
2 A 01/31/2004
5 A 02/01/2005

Group B
1 B 02/01/2005
4 B 01/31/2005

Group C
3 C 02/01/2005

Thanks again for all your efforts.

Tim
 
You should group on {table.changetype} and then on {table.ticket}. Then go to report->edit selection formula->GROUP and enter:

{table.changedate} = maximum({table.changedate},{table.ticket}) and
maximum({table.changedate},{table.ticket}) > currentdate - 8

-LB
 
That worked like a champ!

Thanks so much lbass!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top