Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Querying for inactive customer Post Reply Post New Topic
Author Message
chadbrewyet
Newbie
Newbie


Joined: 26 Oct 2010
Online Status: Offline
Posts: 22
Quote chadbrewyet Replybullet Topic: Querying for inactive customer
     Posted: 26 Oct 2010 at 9:57am
I'm beating my head against the wall on this one.
 
In our database, I have 2 tables I'm interested in: the first is our Accounts and the second is Service Orders.
 
We are trying to run a report to list all of our customers that have not opened a service order since 1/1/2008.  I can select all of my SO's created before a certain date but that list also includes customers that are still actively opening SO's. 
 
I'm looking for a way to pull the AccountName, AccountNumber, and AccountID from the Accounts table based on the most recent DateReceived in the ServiceOrders table being before 1/1/2008.
 
Help!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Oct 2010 at 10:29am
one way,
pull in all orders
group on accountnumber
insert a summary as the maximum service order date at the accountnumber footer
do a group select statement of:
maximum(sodate,accountnumber)<=date(2008,1,1)
IP IP Logged
chadbrewyet
Newbie
Newbie


Joined: 26 Oct 2010
Online Status: Offline
Posts: 22
Quote chadbrewyet Replybullet Posted: 27 Oct 2010 at 3:38am
Fantastic!!!  Worked like a charm.
 
+1000000 to you.  (Do you get points on here?)
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