[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: help?
Hi Yussuf,
>From your code I understand that you are trying to find out the quarter of the
>$doc_date.
A simple way is, during your datetostr conversion, get the MM (month) alone,
instead of MM/DD.
Then Use evaluate to determine the month.
Eg: (Assuming that you are using DB2 database)
Let $month = substr($doc_date,6,2)
Evaluate $Month
When = '01'
When = '02'
When = '03'
Let $quarter = '1'
Similarly you can do it for the rest of the quarters.
You can use this irrespective of the database, as long as you can get the
'MONTH' alone from the $doc_date.
Good Luck
Madan
Andalib Yussuf wrote:
Hello,
I needed some help. I am getting the following errors with this code.
*********unknown comands or extra parameters found
h.DOC_DT &doc_date
let $quarter = datetostr($doc_date, 'MM/DD') !need to put edit mask in
here so that only month and date are compared
If $doc_date >= '10/01' and $doc_date <= '12/31'
let $quarter = '1'
else If $doc_date >= '01/01' and $doc_date <= '04/30'
let $quarter = '2'
end-if
else If $doc_date >= '05/01' and $doc_date <= '06/30'
let $quater = '3'
end-if
else If $doc_date >= '07/01' and $doc_date <= '10/31'
let $quater = '4'
end-If
---------------------------------
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
- References:
- help?
- From: Andalib Yussuf <andalib.yussuf@AMS.COM>