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?
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
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.
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