Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: showing all dates selected...BRAIN BUSTER! Post Reply Post New Topic
Author Message
louisville2k10
Groupie
Groupie
Avatar

Joined: 13 Sep 2010
Location: United States
Online Status: Offline
Posts: 45
Quote louisville2k10 Replybullet Topic: showing all dates selected...BRAIN BUSTER!
    Posted: 30 Nov 2010 at 6:50am
Background:
I have three tables of data I am trying to connect: TableA, TableB, TableC.
 
Each table is connected to one another by USER ID, and each table has a date field in them (but not all are the same).
 
Mission:
I am trying to bring in data from each table into the same report that pertains to each USER ID for a specified window of time.
 
What I've tried:
My record selection is as follows:
TableADate>=?StartDate and TableADate<=?EndDate
 
I've created the following groups:
Grouped on Table A USERID
Grouped on TableA DATE
 
Problem:
The dates showing are only those pertaining to when the data in TableA were created. The problem with this is that the data in TableB and TableC could have been created on days that are left out, so the report isn't showing all of the dates needed.
 
Possible solution?
I'm thinking that if my second group showed everyday in the window of time specified, the report would then show all the data from each table.
 
Does anyone know how to group on a field that just shows each individual day for a window of time specified by a startdate/enddate parameter?
 
 
THANK YOU!!!
 
 


Edited by louisville2k10 - 30 Nov 2010 at 6:52am
Thanks for your help!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 01 Dec 2010 at 3:28am
it's your selection formula...it is only allowing the values from tableA, which is linked to the other tables. To expand it I would try:
 
TableADate in ?StartDate to ?EndDate
or
TableBDate in ?StartDate to ?EndDate
or
TableCDate in ?StartDate to ?EndDate
 
 
HTH
IP IP Logged
louisville2k10
Groupie
Groupie
Avatar

Joined: 13 Sep 2010
Location: United States
Online Status: Offline
Posts: 45
Quote louisville2k10 Replybullet Posted: 08 Dec 2010 at 6:18am

Thank you for the advice, lockwelle, but it didn't get me what I needed. Anybody have a potential alternative solution?

Thanks for your help!
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 08 Dec 2010 at 9:37am
Set your joins between the tables to Full Outer joins.  This will get you all of the data in all of the tables.
 
You then need to create two formulas to group by:
@UserGroup
if IsNull({TableA.UserID}) then
  if IsNull({TableB.UserID}) then
    {TableC.UserID)
  else
    {TableB.UserID}
else
  {TableA.UserID}
 
And
@DateGroup
if IsNull({TableA.Date}) then
  if IsNull({TableB.Date}) then
    {TableC.Date}
  else
    {TableB.Date}
else
  {TableA.Date}
 
Use these for your groups instead of the fields from TableA.
 
Keep the same selection criteria that Lockwelle suggested.
 
-Dell


Edited by hilfy - 08 Dec 2010 at 9:39am
IP IP Logged
louisville2k10
Groupie
Groupie
Avatar

Joined: 13 Sep 2010
Location: United States
Online Status: Offline
Posts: 45
Quote louisville2k10 Replybullet Posted: 17 Dec 2010 at 6:24am
Kudos, Hilfy!
Thanks for your help!
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.020 seconds.