Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Dears,
I have a table of Years and Months like This
Month, Year
Dec, 2015
Nov, 2015
Jan, 2016
Oct, 2015
I want to know in an accurate way how many days are there in each month like this
Month, Year, Days
Dec, 2015 31
Nov, 2015 30
Jan, 2016 31
Oct, 2015 31
I Tried
LOAD *, (MonthEnd(Month)-MonthStart(Month)) as Days
but this resulted in 31 Days in all months although it is known that Nov is only 30 Days.
Thanks in advance
swr
May be like this:
LOAD Month,
Year,
Day(MonthEnd(MakeDate(Year, Month(Date#(Month, 'MMM')), 1))) as Days
FROM...
Update: Sample attached
May be like this:
LOAD Month,
Year,
Day(MonthEnd(MakeDate(Year, Month(Date#(Month, 'MMM')), 1))) as Days
FROM...
Update: Sample attached
One way, you can use Inline, like this?
load * inline
[Month, Days
Jan, 31
Feb, 28/29
Mar, 31
so on..
];
then you can link it or map it.
Hi,
another solution might be:
Day(AddMonths(Date#(Month&Year,'MMMYYYY'),1)-1) as Days
hope this helps
regards
Marco
Nice Sunny T
Thanks brother