Hi and thanks in advance for any help you can give.
Information:
--CR 8.5
--Gupta SQL db
--2 of my parameters are for start and end date
--attempting to also select same start and end date but 1 year before
--parameters I entered were 6/19/07 and 6/21/07
--results show in cross tab but with unexpected end date(and time) for the "last year" part of the SQL Query
my record selection regarding the date looks like this:
the results of showing the SQL Query from the database menu was not what i was expecting:
((RECEIPT_LINE."SALES_DATE" >= {ts '2007-06-19 00:00:00.00'} AND
RECEIPT_LINE."SALES_DATE" [red]<[/red] {ts '2007-06-21 00:00:00.00'}) OR
(RECEIPT_LINE."SALES_DATE" >= {ts '2006-06-19 00:00:00.00'} AND
RECEIPT_LINE."SALES_DATE" [red]<[/red] {ts '2006-06-[red]20[/red] 00:00:0[red]1[/red].00'}))
For the "Last Year" section, I expected to get the same exact beginning and end dates with the exception of the year. I also thought that the comparisons would stay exactly as I wrote them. I put the weird (to me anyway hehe) parts in red above.
What am I doing wrong?
Information:
--CR 8.5
--Gupta SQL db
--2 of my parameters are for start and end date
--attempting to also select same start and end date but 1 year before
--parameters I entered were 6/19/07 and 6/21/07
--results show in cross tab but with unexpected end date(and time) for the "last year" part of the SQL Query
my record selection regarding the date looks like this:
Code:
(({RECEIPT_LINE.SALES_DATE} >= {?startDate} and
{RECEIPT_LINE.SALES_DATE} <= {?endDate})
or
({RECEIPT_LINE.SALES_DATE} >= DateAdd('yyyy',-1,{?startDate}) and
{RECEIPT_LINE.SALES_DATE} <= DateAdd('yyyy',-1,{?endDate})))
((RECEIPT_LINE."SALES_DATE" >= {ts '2007-06-19 00:00:00.00'} AND
RECEIPT_LINE."SALES_DATE" [red]<[/red] {ts '2007-06-21 00:00:00.00'}) OR
(RECEIPT_LINE."SALES_DATE" >= {ts '2006-06-19 00:00:00.00'} AND
RECEIPT_LINE."SALES_DATE" [red]<[/red] {ts '2006-06-[red]20[/red] 00:00:0[red]1[/red].00'}))
For the "Last Year" section, I expected to get the same exact beginning and end dates with the exception of the year. I also thought that the comparisons would stay exactly as I wrote them. I put the weird (to me anyway hehe) parts in red above.
What am I doing wrong?