Forum Discussion
Nandor
9 years agoHelper I
Generate a date key
Hi, I have a classical Date&Time column in my database. I would need to add a new column generated from year, month and day. For example: 20160905 for the 5th of september 2016. Thank yo...
- 9 years ago
In Power Query/M you could use:
Date.ToText([DateColumn], "yyyMMdd")
- 9 years ago
Nandor -
Try this: DateInt = ([Year]*10000)+([Month Nbr]*100)+[DayOfMonth])
- 9 years ago
Hi,
Some very valid suggestions, my personal choice would be to have the following calcualted column:
=FORMAT ( [YourDateField], "YYYYMMDD" )Cheers
tjd
9 years agoImpactful Individual
Nandor -
Try this: DateInt = ([Year]*10000)+([Month Nbr]*100)+[DayOfMonth])