| Author |
Message |
jpsstar
Newbie
Joined: 18 Aug 2011
Location: United States
Online Status: Offline
Posts: 4
|

Topic: Date Range Help Posted: 12 Oct 2011 at 9:08am |
|
Hi all looking for help on a date range.
I want the user to plug in a date range, say 10/01/2011 to 10/10/2011, and have all orders made in that date range returned.
Could someone please walk me through how to set this up?
Thank you.
|
IP Logged |
|
|
|
cmpgeek
Newbie
Joined: 11 Dec 2007
Online Status: Offline
Posts: 39
|

Posted: 12 Oct 2011 at 9:39am |
The way I have to do it now consists of 2 parameters & looks like this:
{order.date} in {?Start Date} to {?Stop Date}
If you are able to create an actual date range parameter you could set it up like this:
{order.date} in {?daterange}
hth, Edited by cmpgeek - 12 Oct 2011 at 9:40am
|
|
Nomi
CR 10
Oracle 9i
|
IP Logged |
|
jpsstar
Newbie
Joined: 18 Aug 2011
Location: United States
Online Status: Offline
Posts: 4
|

Posted: 13 Oct 2011 at 3:35am |
I've entered:
{order.date} in {?Start Date} to {?Stop Date}
When I enter the parameters as prompted (ie 20111001 / 20111016) no orders are returned.
If I manually put: {order.date} in "20111001" to "20111016"
Then orders in that date range are returned.
|
IP Logged |
|
cmpgeek
Newbie
Joined: 11 Dec 2007
Online Status: Offline
Posts: 39
|

Posted: 13 Oct 2011 at 3:55am |
I am guessing that your field {order.date} is not formatted as an actual date. If you change the {?Start Date} & {?Stop Date} parameters to be formatted as numbers instead of dates I think that will solve the problem.
hth,
|
|
Nomi
CR 10
Oracle 9i
|
IP Logged |
|
FrnhtGLI
Senior Member
Joined: 22 May 2009
Online Status: Offline
Posts: 347
|

Posted: 13 Oct 2011 at 3:57am |
|
You could also try:
{order.date}>={?Start Date} and {order.date}<={?Stop Date}
|
|
|< /\ '][' ( )
|
IP Logged |
|
jpsstar
Newbie
Joined: 18 Aug 2011
Location: United States
Online Status: Offline
Posts: 4
|

Posted: 13 Oct 2011 at 4:03am |
Apparently it is formatted as a string.
Is there a way I can have the user input a date parameter and then change it to the appropriate string for selection?
Thanks for the help everyone.
|
IP Logged |
|
cmpgeek
Newbie
Joined: 11 Dec 2007
Online Status: Offline
Posts: 39
|

Posted: 13 Oct 2011 at 4:21am |
Try this:
Change the {?Start Date} & {?Stop Date} to string parameters. Then put the following as the default value for each of them: yyyymmdd and set the min & max length both to 8.
The default value will tell the end user the format it needs to be in and limiting the length will keep them from trying to add the "/"...
hth,
|
|
Nomi
CR 10
Oracle 9i
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|

Posted: 13 Oct 2011 at 6:14am |
or use date type params and convert your field into a date type
date(right({order.date},2)+'/'+mid({order.date},5,2)+'/'+left({order.date},4)) in {?Start Date} to {?Stop Date}
|
IP Logged |
|
|
|