| Author |
Message |
pgreer
Newbie
Joined: 10 Nov 2010
Location: United States
Online Status: Offline
Posts: 7
|

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 Logged |
|
|
|
rkrowland
Senior Member
Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
|

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 Logged |
|
pgreer
Newbie
Joined: 10 Nov 2010
Location: United States
Online Status: Offline
Posts: 7
|

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 Logged |
|
rkrowland
Senior Member
Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
|

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 Logged |
|
pgreer
Newbie
Joined: 10 Nov 2010
Location: United States
Online Status: Offline
Posts: 7
|

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 Logged |
|
rkrowland
Senior Member
Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
|

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 Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|

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 Logged |
|
|
|