Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi based on my date field i need to create month and quarter
01/01 to 20/01 - jan
21/01 to 20/02 - feb
21/02 to 20/03 - mar
21/03 to 20/04 - apr
21/04 to 20/05 - may
21/05 to 20/06 - jun
21/06 to 20/07 - jul
21/07 to 20/08 - aug
21/08 to 20/09 - sep
21/09 to 20/10 - oct
21/10 to 20/11 - nov
21/11 to 31/12 - dec
need to create quarter based on above month
as per HRLinder
big help for month i did this
if (day(TD_DOC_DT)<21 or (day(TD_DOC_DT)>=21 and month(TD_DOC_DT)='dec') , month(TD_DOC_DT), month(addmonths(TD_DOC_DT,2))) as monthcheck
and for quarter
if (day(TD_DOC_DT)<21 or (day(TD_DOC_DT)>=21 and month(TD_DOC_DT)='dec') , 'Q' & ceil(month(TD_DOC_DT)/3), 'Q' & ceil(month(addmonths(TD_DOC_DT,2))/3)) as quartercheck
if i select 21st march it should show Q2. but it showing Q1.
so anyone can help me out
thanks
any help guys
just write date(yourdatefield)
look at qvw, just reload (saved without data to save space)
Hi Rudolf,
i did this
date(TD_DOC_DT) as TD_DOC_DT,
day(TD_DOC_DT) as TD_day,
if (day(TD_DOC_DT)<21 or (day(TD_DOC_DT)>=21 and month(TD_DOC_DT)='dec') , month(TD_DOC_DT), month(addmonths(TD_DOC_DT,2))) as monthcheck,
if (day(TD_DOC_DT)<21 , 'Q' & ceil(month(TD_DOC_DT)/3), 'Q' & ceil(month(addmonths(TD_DOC_DT,2))/3)) as quarter,
but no use. please correct me if i did any mistake
thanks
i will check and tell u
thanks