Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2016 : Report Design  
Message Icon Topic: Matching a record by date Post Reply Post New Topic
Author Message
sanchezgmc06
Groupie
Groupie
Avatar

Joined: 21 Jan 2011
Online Status: Offline
Posts: 97
Quote sanchezgmc06 Replybullet Topic: Matching a record by date
    Posted: 30 Oct 2018 at 3:24pm
I have to create a link from a "date of admission" field in one table to another record in a different table using the "date_of_entry" field.

However the dates will never match.

I need to be able to link the "date of admission" record to the closest "date of entry" record in a different table.

Not sure how to even start that

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 8937
Quote DBlank Replybullet Posted: 05 Nov 2018 at 2:45am
Can you use a stored procedure to do this or are you limited to CR joins?
IP IP Logged
sanchezgmc06
Groupie
Groupie
Avatar

Joined: 21 Jan 2011
Online Status: Offline
Posts: 97
Quote sanchezgmc06 Replybullet Posted: 08 Nov 2018 at 6:44am
Not sure

I will be writing the report in a command statement
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 8937
Quote DBlank Replybullet Posted: 15 Nov 2018 at 3:13am
I likely would handle this via a store procedure using a temp table to join the tables where the dates are >= the other date, do a rank over order to get the first record and then select a final table result against that
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.047 seconds.