Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I am working on an excel sheet with different columns for a date , ie Year, month, day.
LOAD Year,
Month,
Day,
Hour,
Celsius,
Rain_mm,
Sun_Minutes,
MakeDate (Day&Month&Year) as Date
i have been trying using MAKEDATE to generate the date but in returns...i have this...01.01.112012, 01.01.122012, etc...
what i have done wrong ?
thanks
JP
As already suggested, I'd use Date(MakeDate(Year, Month,Day),'DD.MM.YYYY') AS Date.
MakeDate (Year, Month, Day) as Date
Hi,
go to help menu check the syntax of MakeDate()
Regards
thanks but now it is returning 01.01.2012...that it....;) any idea why ?
Thanks max dreamer, i have started with this point
MakeDate(YYYY [ , MM [ , DD ] ] )
Returns a date calculated from the year YYYY, the month MM and the day DD.
If no month is stated, 1(January) is assumed.
If no day is stated, 1 (the 1:st) is assumed.
Examples:
makedate(1999) returns 1999-01-01
makedate(99) returns 0099-01-01
makedate(1992,12) returns 1992-12-01
makedate(1999,2,14) returns 1999-02-14
but this is not 100% clear...and working
best
Could you post some sample records of your data? Year, Month, Day must have a numeric representation, i.e. Month is not just a text value like 'Jan'. But from what you've posted above, I would expect some dates returned like 01.01.2012.
Or are you asking about the format? You can change the format using the script variables, or Date() formatting function:
Date(MakeDate (Year, Month, Day),'YYYY-MM-DD') as Date
but this is not 100% clear...and working
best
What's unclear? What is not working? You need to tell us the problems to help you.
what is the date format set in your script?
if you need it in a different format, use the date function to change the format
Date(MakeDate(Year, Month,Day),'YYYY-MM-DD') AS Date
Hi,
try below,
LOAD *,MakeDate(Year,Month,if(isnull(Day) or len(trim(Day))<1 ,'1',Day)) as makeDate INLINE [
Year, Month, Day
2015, 3, 1
2014, 2
2015, 3, 15
];
Regards