Print Page | Close Window

Comparision between two tables

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=14478
Printed Date: 03 May 2024 at 6:21pm


Topic: Comparision between two tables
Posted By: achandana01
Subject: Comparision between two tables
Date Posted: 24 Sep 2011 at 7:20am
Hi,
 
I have two tables like this
 
Account ID DC Date
123456 5/6/2011
567890 6/26/2011
 
Transaction Account ID Post Date
300 123456 5/6/2011
301 123456 5/7/2011
302 123456 5/8/2011
303 567890 6/26/2011
304 567890 6/26/2011
305 567890 6/26/2011
306 567890 7/22/2011
 
I need Count of the accounts whose Postdate > DC Date in other words for Account ID 123456 I need a count when postdate > dc date so the count will be 2 the final result should look like this
123456 2
567890 1
 
I grouped it by account id and used the following formula
if({DCdate},{accountid})< ({postdate},{accountid}) )
then 1
else 0
 
but it is giving me syntax error,donno how to proceed further.If you help me out that will be great.
 
Thanks in advance


-------------
chand



Replies:
Posted By: DBlank
Date Posted: 26 Sep 2011 at 4:10am

assuming you joined the table on accountid...

if {tableDC.DCdate}<{tablePD.PostDate} then 1 else 0
 
group on accountID
palce SUM of formula in group header
suppress footer and details



Print Page | Close Window