Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Help! New to this... Post Reply Post New Topic
Author Message
roastbeef
Newbie
Newbie
Avatar

Joined: 27 Aug 2010
Location: United States
Online Status: Offline
Posts: 1
Quote roastbeef Replybullet Topic: Help! New to this...
     Posted: 27 Aug 2010 at 11:37am
I work for a small heating/cooling contractor. I'm running Crystal 8.5, and have very little training on it.

My boss wants me to tell him how many customers we done service for in the past 10 years.

I have set up a report that has the customer information table in the main report, and the service job information table as a subreport.

The problem is, it's giving me all the customers in the database, not just the ones that we've done service for in the past 10 years.

How do I get rid of the customer's that I don't want on the report?
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 28 Aug 2010 at 6:38am
The answer depends on your data. I will assume there is some form of a date in the database that is associated with your customer.
 
You then an apprpriate date function perhaps DATEADD in this case and create something like
 
 Year(DateField) > =  DATEADD("yy",-10,Date())
 
You may need to clean the syntax up but the logic is to look at the year part your date field and have it show everything greater than or equal to 10 years from today. The negative ten (-10) subtracts 10 years from current year
 
This would go in the Record Selection formula or in the Command object if v.8.5 supported them
 
From Crystal Help (Search Help)
Year function - extracts the year from a date and returns it as a Number. Year(x)
 
DateAdd has a number of possibilites.
 
Hope this helps.
 
Regards,
 
John W.
 
 
 
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum