Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
I want to display dates from 2008 to 2014
but this code will displaying only 2010 dates
tell some one help me
where i am wrong
set vDateMin = MAKEDATE(2008,1,1);
set vDateMax = MAKEDATE(2014,12,31);
TempCalendar:
LOAD
$(vDateMin) + RowNo() - 1 AS DateNumber,
Date($(vDateMin) + RowNo() - 1) AS TempDate
AUTOGENERATE 1
WHILE $(vDateMin)+IterNo()-1<= $(vDateMax);
MasterCalendar:
LOAD
TempDate AS CreatedDate,
Month(TempDate) AS CalendarMonth,
Year(TempDate) AS CalendarYear,
Month(TempDate) & '-' & Year(TempDate) AS CalendarMonthAndYear
RESIDENT TempCalendar ORDER BY TempDate ASC;
DROP TABLE TempCalendar;
Thanks In Advance
Niranjan
Your original code fixed with my first post gives me all dates from 1/1/2008 to 12/31/2014. See the attached file.
The variables need to be numbers and you need to use let instead of set:
let vDateMin = num(MAKEDATE(2008,1,1));
let vDateMax = num(MAKEDATE(2014,12,31));
Date($(vDateMin) + RowNo() - 1) AS TempDate
Instead of this use this one
RowNo()-1+Floor($(vDateMin) As TempDate
LET vDateMin = Num(MAKEDATE(2008,1,1));
LET vDateMax = NUM(MAKEDATE(2014,12,31));
TempCalendar:
LOAD
$(vDateMin) + RowNo() - 1 AS DateNumber,
Date($(vDateMin) + RowNo() - 1) AS TempDate
AUTOGENERATE 1
WHILE $(vDateMin)+IterNo()-1<= $(vDateMax);
MasterCalendar:
LOAD
TempDate AS CreatedDate,
Month(TempDate) AS CalendarMonth,
Year(TempDate) AS CalendarYear,
Month(TempDate) & '-' & Year(TempDate) AS CalendarMonthAndYear
RESIDENT TempCalendar
ORDER BY TempDate ASC;
DROP TABLE TempCalendar;
guys again im getting same values
Your original code fixed with my first post gives me all dates from 1/1/2008 to 12/31/2014. See the attached file.
There is nothing wrong with my code.
It's giving me All required dates.
yes but did you check table viewer it shows like 2010
Thanks for your help full answer
Table Viewer stops showing data after a certain number of rows. You're over the limit.
Thank you so much smith