Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have the field quarter that doesn't show the correct quarter numbers:
Based on the script below,
'Q' & Ceil(Month(Date(Date#(OrderDate, 'YYYYMMDD'),'DD-MM-YYYY') /3)) as Quarter,
OrderDate is a string therefore I used the Date# to translate it to a date.
I get these results
What am I doing wrong?
Cheers!
iSam
Hi Isam,
I cannot see the attached image, but you have a parenthesis moved, the correct syntax is to divide the month into 3:
'Q' & Ceil(Month(Date(Date#(OrderDate, 'YYYYMMDD'),'DD-MM-YYYY')) /3) AS Quarter,
Hope that helps.
BI Consultant
Hi Isam,
I cannot see the attached image, but you have a parenthesis moved, the correct syntax is to divide the month into 3:
'Q' & Ceil(Month(Date(Date#(OrderDate, 'YYYYMMDD'),'DD-MM-YYYY')) /3) AS Quarter,
Hope that helps.
BI Consultant
Hi
You have a misplace ) sign.
'Q' & Ceil(Month(Date#(OrderDate, 'YYYYMMDD')) / 3)
You could also use
QuarterName(Date#(OrderDate, 'YYYYMMDD'))
Hope that helps
Jonathan