[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



Hello,
First you need to indicate the format of your date, then you could go
for the comparison,
for example select substr(to_Char(effdt,'dd/mm/yyyy'),1,4)
this will give you format per your requirements and then you can compare
Hope this helps
Prasanna

Andalib Yussuf wrote:
>
> Thanks for the code sample but I am comparing four quarters.
>
>  If docdate is between date 1 and date 2 let quarter = 1
> else if
>       "                                        "
> so on
>
> I was wondering if there is a reserved word I could use or something. I
> already tried using the code below and it didn't work. Hope you can help.
> Thanks for the quick reply I appreciate it.
>
> ($doc_date >= '01/01' AND
>  $doc_date <= '04/30'
>  let $quarter = 1)