Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Parameter Fields Start Date and End Date Post Reply Post New Topic
Author Message
pgreer
Newbie
Newbie
Avatar

Joined: 10 Nov 2010
Location: United States
Online Status: Offline
Posts: 7
Quote pgreer Replybullet Topic: Parameter Fields Start Date and End Date
    Posted: 29 May 2012 at 9:06am
I am creating a report with parameter fields of ?Start Date and ?End Date.  Datatype is DateTime for parameter.  I am getting an error when i am passing the ?EndDate parameter to the EndDateString field for comparing the parameter field and Date field in the database.  The error I am getting when i try to run the report is:  "A number, currency amount, boolean, date, time, date-time, or string is expected here." This is the code in the EndDateString that it is erroring out on. Help ! :-)
 
 {?End Date:}<= VRAUDIT.DATE
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 29 May 2012 at 11:58pm
Remove the colon;
 
 {?End Date}<= VRAUDIT.DATE
 
On another note, might just be me but surely you want your end date to be >= to the data date?
 
IE if you're using these parameters to select data between two dates you'd want the following;
 
{?startdate} <= table.date
and
{?enddate} >= table.date
 
Forgive me if I'm misunderstanding the purpose of your date parameters.
 
Regards,
Ryan.
IP IP Logged
pgreer
Newbie
Newbie
Avatar

Joined: 10 Nov 2010
Location: United States
Online Status: Offline
Posts: 7
Quote pgreer Replybullet Posted: 30 May 2012 at 6:15am
Ryan,
        Thanks so much. That worked but, now i cannot get my group by date to work.  GroupName: VRAUDIT.DATE(DateTime).  The Field is VRAUDIT.DATE with Datatype: DateTime. ex Data: 25-Nov-2011 7:05am.  I have formatted my fields ?Start Date, ?End Date, and GroupBy(VRAUDIT.DATE(DateTime) with System Default Short Format(3/1/1999 1:23:45PM).  Do i need to convert the date for it to group by properly ?
 
Thanks for your help in advance !
 
Paul
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 30 May 2012 at 10:56pm
How are you wanting to group the date? Years, months, days?
 
Grouping it by the actual datetime field will be grouping it by seconds - ie only records with the same datetime to the exact second will be grouped together.
 
Regards,
Ryan.
IP IP Logged
pgreer
Newbie
Newbie
Avatar

Joined: 10 Nov 2010
Location: United States
Online Status: Offline
Posts: 7
Quote pgreer Replybullet Posted: 31 May 2012 at 3:07am
Ryan,
 
       I formatted the Group by field to be 3/1/1999 just like the Date field in the report.  With the Group by field formatted this way it rounds off to the nearest minute.  Could this be causing issues on why the group by is not working ? Yes i would like to group by mm/dd/yyyy.
 
Thanks,
 
Paul


Edited by pgreer - 31 May 2012 at 3:08am
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 31 May 2012 at 4:21am
Although you've formatted the field to not show the time element - it's still there and is considered when grouping.
 
Create a new formula as follows;
 
date(year({VRAUDIT.DATE}), month({VRAUDIT.DATE}), day({VRAUDIT.DATE}))
 
If you group by this formula instead of the vraudit.date field your records should be grouped by day.
 
Regards,
Ryan.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 31 May 2012 at 4:29am
You can also use the date grouping options.
open the group expert
select the group in the group by window
select options
on the common tab Change the last pick list option to the type you want (for each day)
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.016 seconds.