Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have exported MongoDB collection into an xls file and i am using this as the data source for my project.Below is one of the rows of xls file
XXXXX,"XXXXX","SUCCESS",2013-03-21T02:58:07Z,"XXXXXX" |
Now I want to extract only the month from "2013-03-21T02:58:07Z".Please suggest the appropriate function to use in load script.
Hi yomishra,
Try this one
Month(Left('2013-03-21T02:58:07Z',10)) ==> if doesn't work then use this
Month(Date(Date#(Left('2013-03-21T02:58:07Z',10),'yyyy-MM-dd')))
Regards,
Sokkorn
You can try: mid('2013-03-21T02:58:07Z',6,2) as Month
HI
Try like this
SubField('2013-03-21T02:58:07Z','-',2)
Hope it helps
Thanks Gysbert it worked. Is there any another function available through which i can convert this number into month name say for March it will be 3, for April it will be 4. Actually I want to Display Month Name not the number.Can you please suggest something on this also.
Thanks Mayil it also worked .Can you please see my reply to Gysbert answer.
Hi yomishra,
Try this one
Month(Left('2013-03-21T02:58:07Z',10)) ==> if doesn't work then use this
Month(Date(Date#(Left('2013-03-21T02:58:07Z',10),'yyyy-MM-dd')))
Regards,
Sokkorn
Thanks Sokkorn!!!You answered exactly what i want .