Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
My data source is an Excel spreadsheet. One of the columns (Policy Date) is define as a date field in MM/DD/YYYY format.
In my script I'm trying to perform
Month([Policy Date]) as Month
and
Year([Policy Date]) as Year
to no avail.
What do I need to do to extract the month and year from an Excel date field?
hi,
you can use the following code
tab1:
LOAD date#([Policy Date],'MM/DD/YYYY ') as [Policy Date];
LOAD [Policy Date]
from ......abc.xls;
tab2:
load year([Policy Date]) as year,
month([Policy Date]) as month
resident tab1;
hope that it should work
thanks
hi,
you can use the following code
tab1:
LOAD date#([Policy Date],'MM/DD/YYYY ') as [Policy Date];
LOAD [Policy Date]
from ......abc.xls;
tab2:
load year([Policy Date]) as year,
month([Policy Date]) as month
resident tab1;
hope that it should work
thanks
Richard,
Please try this:
Month(Date([Policy Date]) as Month,
Year(Date([Policy Date]) as Year
Let me know if it works or not.
Thanks Rocky. Did the job.