i have a column accounting_month in interger format(200,904).
the initail 4 number is year 2009 and last 2 are month 04.
i want to convert it into date format and then i want it to compare with current date.
if the cuurent month and year are same as accounting_month month and year then flag cloumn(new column) value sholud be 1 or else 0.
example today date 10/22/2013(mm/dd/yyyy) and value from accounting month is 201310(yyyymm) then flag value should be 1 or else 0.
please help me.
its v urgent
when accounting_month =
extract(year from current_date) * 100
+ extract(month from current_date)
There's a slighly shorter version, but it's based on the internal storage of a date and thus not as easy to understand:
when accounting_month = (current_date / 100) + 190000