Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Date Parameter Question? Post Reply Post New Topic
Author Message
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Topic: Date Parameter Question?
     Posted: 03 Mar 2010 at 5:22pm
Hello,
 
Is there a way of adding a day or days to a date parameter? Example would be that I put in the date 03/03/2010 and the report would then select +1 day 03/04/2010.
 
My thought is that I already made a report and I could then build another report and add these reports as subreports. I would then select say the 03/01/10 and the subreports would then add one day for each.
 
subreport 1 -      03/01/10
subreport 2 - +1 03/02/10
subreport 3 - +2 03/03/10
 
and so on....
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 04 Mar 2010 at 5:18am
In the record selection editor:
 
{table.datefield}=dateadd('d', +1, {?DateParam})
 
HTH
IP IP Logged
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Posted: 04 Mar 2010 at 8:24am
The way that the report is setup is it doesn't pull from just one
{table.datefield}. The {?dateparam} is the date pulling between two dates.
 
Date Confined
{Jail_Confinement.Date_Confined}<={?date}     
 
Date Released
isnull ({Jail_Confinement.Date_Released}) or
{Jail_Confinement.Date_Released}>={?date}
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 04 Mar 2010 at 10:39am
So the param is returning an array and you want to do what with the array? Add 1 to the last date in the array or what? I'm not understanding exactly what you want to do now.
 
 
EDIT
Sorry. I think I understand somewhat, but you're going to have to fill in the rest. Do you want something like this in the selection formula:
 
{Jail_Confinement.Date_Confined}<=dateadd('d', +1, {?date})     
 
or
 
isnull ({Jail_Confinement.Date_Released}) or
{Jail_Confinement.Date_Released}>=dateadd('d', +1, {?date})


Edited by FrnhtGLI - 04 Mar 2010 at 10:46am
IP IP Logged
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Posted: 04 Mar 2010 at 11:03am
Originally I created a report with a date param to show inmates that are in custody on a certain date. Now that I have that report I would like to somehow do each day for the month. Thought I could do some sort of adding 1 day to 30 days to each subreport to accomplish.
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 05 Mar 2010 at 10:29am
I think the formula that I have above should get you what you need. That formula will add one day to the date parameter. If you want two or more, put that number where the +1 is.
IP IP Logged
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