Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi
I have a file name like this
Abc-June-2021.xlsx
Now i am trying to extract Month and year like this in script
Trim(Replace(FileBaseName(),'MMailBoxUsage-','')) as MailBox_Date
and the output is June-2021 .. but now i want to extract Month and Year separately from MailBox_Date field ..
how i do this ?
if you have :
Set LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';
you can use Month(Date#(MailBox_Date,'MMMM-YYYY') for the month and ,Year(Date#(MailBox_Date,'MMMM-YYYY')) for the year
for example :
Input:
LOAD *,Year(Date#(MailBox_Date,'MMMM-YYYY')) as Year_MailBox_Date,Month(Date#(MailBox_Date,'MMMM-YYYY')) as Month_MailBox_Date INLINE [
MailBox_Date
June-2021
];
the output: