Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Help needed with select formula Post Reply Post New Topic
Author Message
ssmith147
Newbie
Newbie


Joined: 26 Aug 2008
Online Status: Offline
Posts: 3
Quote ssmith147 Replybullet Topic: Help needed with select formula
     Posted: 26 Aug 2008 at 6:44am
I'm fairly experienced with VB, but I'm totally new to CR, so please bear with me.
 
I have two tables, tblCustomers and tblVisitDate. The CustID field is a unique key in tblCustomers. The CustID field is used to identify the customer in each entry in the tblVisitDate table.

I want to select only the customer records in tblCustomers that have an entry in tblVisitDate matching a specific criteria. Also, I only want to select that record one time (I'm printing mailing labels).

I can perform this function in SQL using the IN and WITH keywords, but I don't know where to start with the CR selection formulas. Any help is appreciated- plus I would also appreciate a link to some online resources that explain how to write formulas.

Thanks in advance!
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 26 Aug 2008 at 1:51pm
1.  Add both of your tables to the report.  Link from the CustID in tblVisitDate to the CustID in tblCustomers. 
2.  In the Select Expert, set up your selection criteria.
3.  In the report, group on the Customer name + the CustID (so that you get one for each different customer, even if two or more have the same name!)
4.  Suppress the detail section.  Put your mailing label data in one or more Group Header sections.  This way you'll only get it once, even if the customer had more than one visit that meets the selection criteria.
 
-Dell
IP IP Logged
ssmith147
Newbie
Newbie


Joined: 26 Aug 2008
Online Status: Offline
Posts: 3
Quote ssmith147 Replybullet Posted: 27 Aug 2008 at 7:50am
Dell,
 
Thanks very much for your help on this- your information on how to ensure that only one record is printed will be extremelyt valuable to me long term, also.
 
I have a follow up question concerning this, but I'm going to post it in its own thread since its fairly off topic.
 
Thanks again!
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