Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Get date from a table to use as parameter Post Reply Post New Topic
Author Message
jmiller121
Newbie
Newbie


Joined: 12 Apr 2007
Online Status: Offline
Posts: 5
Quote jmiller121 Replybullet Topic: Get date from a table to use as parameter
    Posted: 15 Apr 2007 at 3:03pm
Hi, CR Novice here....

I have several payroll reports that need run every 2 weeks.  I have a table (tblPayrollEndDates) that list the last day of the pay period (which is 2 weeks long)  This table includes dates both past and future.  What I would like to do is select the most recent date in the tblPayrollStartDates table that has not yet passed and use that as a parameter to base my subreports on.  How do I get that single date value into a formula field or a parameter field so I can reference it?

 

Thanks for your help!
J Miller



IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 18 Apr 2007 at 9:14am
Which database are you using?  If Crystal allows it for your db, you could add a command text with something like the following SQL ("sysdate" is the current date in Oracle, it may be different in other db's):
 
Select max(End_Date)
from tblPayrollEndDates
where End_Date <= sysdate
 
You would then use that value as the parameter to your subreports.
 
-Dell
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.015 seconds.