Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have have the year and month filed i want to combine this year and month .
I am using
makedate(year,month,01) as date,
but this is not working can anyone help me?
Months:
Mapping LOAD * Inline
[months, monthNo.
jan, 1
feb, 2
mar, 3
apr, 4
may, 5
jun, 6
jul, 7
aug, 8
sep, 9
oct, 10
nov, 11
dec, 12
];
MakeDate(year, ApplyMap('Months', month), 1) as date
Maybe you need to use 1, instead of 01. Try this:
Date(MakeDate(year, month, 1), 'MM/DD/YYYY') as date,
Hi
its working for me
dual(MakeDate(2011,01,3),'MMM/DD/YYYY')
no it is not work
Do you have integer values or alphabets(Jan,Feb,..) in Month field?
it is also not working for me
You need integer values for year and month. If you don't have that, then you need to transform them into integers. For months you might be able to use a mapping load and applymap.
Best,
Sunny
Alphabets(jan, feb )
like
how to change alphabets to interger
It's not going to work if you month field is string like Jan, Feb...
Try
date(date#(year & month, 'YYYYMMM'))