Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: select between 2 dates Post Reply Post New Topic
Author Message
spikestertje
Newbie
Newbie


Joined: 14 Oct 2011
Location: Netherlands
Online Status: Offline
Posts: 5
Quote spikestertje Replybullet Topic: select between 2 dates
    Posted: 24 Oct 2011 at 10:39am
In the Oracle database the date/time is stored in a string.
I already have created an SQL expression to sort it ascending as followed:
TO_TIMESTAMP("EVENTS"."EVENTCREATED" , 'DD-MM-YYYY HH24:MI:SS')

No I need to make an option so I can select a start and end date.
for example if I want to select dates between 15-09-2011 25-09-2011.

I already tried to create a parameter for this, but when I select the the time frame, I get everything between 15 & 25-09-2011 but also records from 01-10 and further.

Now I've got two questions:
Do I need to make an expression of parameter field from the string as the "TO_TIMESTAMP"?
How can I create the option, so I can select the start and ending date?

Thank you in advance

IP IP Logged
SamD
Newbie
Newbie


Joined: 24 Oct 2011
Online Status: Offline
Posts: 15
Quote SamD Replybullet Posted: 24 Oct 2011 at 10:57am
yes, you would need to add a date range in the parameter field.
 
Also, Formula field, create Start Date and End Date
 
ex:
Start Date formula field
Minimum ({?Date Range})
 
End Date formula field
Maximum ({?Date Range})
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 27 Oct 2011 at 3:53am
yes, you would need 2 parameters, one for start and the other for stop.
 
as long as your field is a datetime, like your parameters then a simple formula in the Report/Selection Formulas/Record like:
 
{table.eventCreated} in {?start} to {?end}
 
should work...it will return true only for rows in the date range.
 
HTH
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.000 seconds.