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!

crystal 8 formula

Status
Not open for further replies.

lrather

MIS
Apr 30, 2003
7
US
I am new at creating formulas in crystal. I am using version 8 of crystal.

My question: This is what I am trying to get to in my report; I need to know out of my sql database what client has not had a active service in the last year.

If someone could help me with this I would be very thankful.

Thanks to whom ever takes this this task on.

Lrather
 
First, you need to decide what clients are under consideration--all customers from years ago, only those within the last two years, etc., and then use something like this in your record select statement:

{yourtable.datefield} in Date(2001, 01, 01) to CurrentDate//for customers within last couple of years

Do not use a date select if you want to consider all previous customers.

Group on clientID and add {clientname} to the group header

Go to report->edit selection->group and enter the following group select statement:

maximum({yourtable.datefield},{clientID})<=DateAdd(&quot;yyyy&quot;,-1,Currentdate)

This will give you a list of names for clients who have not been served within a year of the currentdate. If you want to look at customers who have not been served by a specific date, you can replace the DateAdd part of the formula with the specific date, e.g., Date(2002, 01, 01).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top