[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: how to compare dates
As others have suggested and assumming that the rows you retrieve are
limited to a specific year, then just do ...
h.DOC_DT &doc_date
let $quarter = datetostr(&doc_date,'Q')
If you're using dynamic SQL in the select statement anywhere, you may need
to specify the "&" variable as a date, such as...
h.DOC_DT &doc_date=date
let $quarter = datetostr(&doc_date,'Q')
The error you were getting is correct, you are missing an argument in your
code, each line would need to be like...
If $doc_date >= '10/01' and $doc_date <= '12/31'
Plus you need some more "end-if" statements to match the "if"s
HTH,
Don
On Thu, 25 Jul 2002, Andalib Yussuf wrote:
> Hello Rick,
> thanks for the quick reply. I have provided my code below and I did use the
> datetostr function. This is what I have and it is not working
>
> h.DOC_DT &doc_date
> let $doc_date = datetostr(&doc_date, ('MM/DD'))
> If $doc_date >= '10/01' and <= '12/31'
> let $quarter = '1'
> else If $doc_date >= '01/01' and <= '04/30'
> let $quarter = '2'
> else If $doc_date >= '05/01' and <= '06/30'
> let $quarter = '3'
> else If $doc_date >= '07/01' and <= '10/31'
> let $quarter = '4'
> End-If
>
> The current error I get is '<=' missing arguments
>
-----------------------------------------------------------------------
Donald Mellen | Ray Ontko & Co. - Richmond, IN - http://www.ontko.com/
donm@ontko.com | "In the beginning, there was nothing, which exploded"