Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am selecting data out of csv file (small file with 8 columns and 1000 rows). 2 of the columns are date (Start_Dt & End_Dt).
I want to get Month and Year out of those dates: Month(Start_Dt) & Year(End_Dt). It does not work. I get no data (just dashes "-").
The Start_Dt and End_Dt dates show up just fine.
However, if I convert that .csv file to excel (.xlsx) and use the same script (except selecting from xcel), Month and Year function works
just fine. But since the source is .csv, we don't want to keep converting to xcel on daily basis.
I have tried using trim, date function on the .csv file but no-go. Any help/pointers are appreciated.
Thanks,
-Sam
Sam,
Try to use date#() function:
month(date#(Start_Dt, 'format'))
Format must be according to the specific date format in your file, e.g. 'MM DD YYYY', or 'M/D/YY', etc.. I cannot gues, but van see it...
Regards,
Michael
Sam,
Try to use date#() function:
month(date#(Start_Dt, 'format'))
Format must be according to the specific date format in your file, e.g. 'MM DD YYYY', or 'M/D/YY', etc.. I cannot gues, but van see it...
Regards,
Michael
Hi
Try the date format when you are loading the data from CSV and check whether the format of the date, if it is not in proper format then then convert date to valid format by using date#() in combination with Alt(). Check the date values that are not giving month and year.
Hope this helps you.
Regards,
Jagan.
Michael,
Thanks!! I was using date but did not work... date# did the trick.
Thanks much.
-Sam