Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
I have a date filed with everyday in the year. I need to create a new column to show for each date the next year December second Sunday date.
for example today we are in 11/3/2015.. next year is 2016.. second Sunday in Dec 2016 is 12/11/2106 and need to do the same thing for two years from the date so it will be 12/10/2017..
Any idea how to do the logic..
Thank you in advance!
This:
Table:
LOAD *,
WeekDay(FlagDate) as Day,
WeekDay(FlagDate1) as Day1;
LOAD *,
WeekEnd(YearEnd(AddYears(Date, 1)) - 23) as FlagDate,
WeekStart(YearEnd(AddYears(Date, 1)) - 17, 0, 3) as FlagDate1;
LOAD Date(MakeDate(2013, 1, 1) + RecNo() - 1) as Date
AutoGenerate MakeDate(2030, 1, 1) - MakeDate(2013,1,1);
FlagDate is Sunday
FlagDate1 is Thursday
May be this:
Table:
LOAD *,
WeekEnd(YearEnd(AddYears(Date, 1)) - 23) as FlagDate;
LOAD Date(MakeDate(2013, 1, 1) + RecNo() - 1) as Date
AutoGenerate MakeDate(2019, 1, 1) - MakeDate(2013,1,1);
thank you so much! is there a way the second Thursday of the same month as well?
This:
Table:
LOAD *,
WeekDay(FlagDate) as Day,
WeekDay(FlagDate1) as Day1;
LOAD *,
WeekEnd(YearEnd(AddYears(Date, 1)) - 23) as FlagDate,
WeekStart(YearEnd(AddYears(Date, 1)) - 17, 0, 3) as FlagDate1;
LOAD Date(MakeDate(2013, 1, 1) + RecNo() - 1) as Date
AutoGenerate MakeDate(2030, 1, 1) - MakeDate(2013,1,1);
FlagDate is Sunday
FlagDate1 is Thursday
works just perfect! thanks again!