Print Page | Close Window

Matching a record by date

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22686
Printed Date: 01 May 2024 at 10:27pm


Topic: Matching a record by date
Posted By: sanchezgmc06
Subject: Matching a record by date
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




Replies:
Posted By: DBlank
Date Posted: 05 Nov 2018 at 2:45am
Can you use a stored procedure to do this or are you limited to CR joins?


Posted By: sanchezgmc06
Date Posted: 08 Nov 2018 at 6:44am
Not sure

I will be writing the report in a command statement


Posted By: DBlank
Date 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



Print Page | Close Window