Print Page | Close Window

Date comparison probs

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3042
Printed Date: 06 May 2024 at 10:49pm


Topic: Date comparison probs
Posted By: markh
Subject: Date comparison probs
Date Posted: 28 Apr 2008 at 12:12am
Hi Everyone,
Real newbie at CR & i am trying to create a report that has two date ranges on the same table data that i want to create a sales report for.
I want to compare [example] feb 2007 with feb 2008 sales figures for category,qty , $value etc but i want to make the date ranges by submitting parameters.
All i get is thousands of results because the join is multiplying the data.




Replies:
Posted By: BrianBischof
Date Posted: 28 Apr 2008 at 4:20pm
The reason why you are getting thousands of records is probably because you are joining the same table to itself (so that both date ranges can be compared) and this produces a 'cartesian product' (which means you get thousands of duplicate records). Have you looked into using a crosstab object? This summarizes the data for you and puts the data side by side in two columns. You can also tell it to group by year. This might be what you need.

I cover everything you need to know about cross-tab reports in my Encyclopedia book. You can find out more about my books at http://www.amazon.com/exec/obidos/ASIN/0974953601/bischofsystem-20 - Amazon.com or reading the http://members.crystalreportsbook.com - Crystal Reports eBooks online.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window