4 Replies Latest reply: Oct 13, 2012 3:52 PM by steve peroni

# Calendar problem

Dear all,

how can I create a calendar having the year values only ?

For example:

periodo between  2010  and 2012

Is is possible without a range date ?

• ###### Re: Calendar problem

Hi

I think , if i understand your requirement, r u looking like this?

Year(DateField) as Year,

Sales

From TableName;

• ###### Re: Calendar problem

Yes, but I solved maybe.

I created the calendar by the makedate function: makedate(firstyear, 01,01) as mindate and makedate(lastyear,12,31) as maxdate. It should be correct, I hope...

stefan

• ###### Re: Calendar problem

HI

Ya , its give.. For additional information..

Try like this

Let vEnd = Num(Today(1));

Let vStart = Num(YearStart(\$(vEnd),-4)) - 1;

Generate:

LOAD Date(\$(vStart) + IterNo()) AS Date , num((rand() * 100) + 1000, '##0') as Sales

AutoGenerate 1

While (\$(vStart) + IterNo()) <= \$(vEnd);

Tablename:

LOAD Month(Date)*1 AS MonthKey1, Month(Date) as Month,Year(Date) AS Year,Day(Date) AS Day,Num(Date) as DateNUm ,

Dual('Q' & Ceil(Month(Date) / 3) & ' ' & Year(Date), QuarterName(Date)) as Quarter,

MonthName(Date) as Monthyear

Resident Generate;

Hope that helps..

• ###### Re: Calendar problem

Thanks, really much more complete.