Forum Discussion
Direct Query - 2 Digit Month Insanity
- 6 years ago
YEAR and MONTH take Date as an argument, with your syntax it's just the number of days starting from 1899-12-31, where 2019 gives year 1905 and 4 gives 1 (January 1900)
You can use eitherDateofServiceYearMonth = RequestSummary[DateofServiceYear]*100 + RequestSummary[DateofServiceMonth]or
DateofServiceYearMonth = YEAR(RequestSummary[DateofService])*100 + MONTH(RequestSummary[DateofService])Personally I would use the first one
Here is a link to a screen shot.
https://www.dropbox.com/s/6o9gjfgmn18i2sh/2020-04-24_16-21-22.png?dl=0
My original column is DateofService which I broke out into DateofServce Year and separately Month. Finally your column is DateofServiceYearMonth.
DateofServiceYearMonth = YEAR(RequestSummary[DateofServiceYear])*100 + MONTH(RequestSummary[DateofServiceMonth])
I am getting random numbers it appears ?
YEAR and MONTH take Date as an argument, with your syntax it's just the number of days starting from 1899-12-31, where 2019 gives year 1905 and 4 gives 1 (January 1900)
You can use either
DateofServiceYearMonth = RequestSummary[DateofServiceYear]*100 + RequestSummary[DateofServiceMonth]
or
DateofServiceYearMonth = YEAR(RequestSummary[DateofService])*100 + MONTH(RequestSummary[DateofService])
Personally I would use the first one
- FlyBoyNight6 years agoNew Member
Stachu,
Thank you so very, very much. I can't tell you how many hours I spent trying different iterations of other options. This is elegant and perfect for what I need.
Cheers!
- Stachu6 years agoCommunity Champion
glad to help 🙂