Free Trial

Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

Challenge #46: Formatting a Date from an Integer

jarrod
ACE Emeritus
ACE Emeritus

went with a conditional and regex on this one

Spoiler
iif(left([date],1)='1','20','19')+REGEX_Replace(Date,'\d(\d{2})(\d{2})(\d{2})','$1-$2-$3')
Guillaume_G
8 - Asteroid

Here you go !!

Arun_KV
8 - Asteroid

Here we go...  Thanks !!

xinyoo
6 - Meteoroid

nice and simple

Rohit_G13
7 - Meteor

A very common requirement with multiple ways to get to the solution

 

Thanks

Rohit Govind 

jcollake
6 - Meteoroid

I tried not to over complicate things here...went with regex which seems to be the unpopular route on this one.

 

Spoiler
jcollake_0-1591371659275.png

 

wincenzo
7 - Meteor
Spoiler
wincenzo_0-1591601641793.png

Two possible solutions

Nicholas_Norton
8 - Asteroid

Solution and spoiler attached 🙂

 

Spoiler
I tried to use the TrimLeft function at first to remove the number, but it accidentally removed too many! I had to use the Right function instead, since all the data has the same amount of characters. I also noticed that I could have saved a step and done the DateTimeParse function within the If statement, but it made more sense for me to split them into two separate columns. Overall, it was a nice and easy challenge that took me around 20 minutes to complete. 
snaps56_0-1591733685915.pngsnaps56_1-1591733716152.png

 

 

cmv
7 - Meteor

This one was pretty easy!

 

Spoiler
cmv_0-1591879729666.pngToDate(ToString(ToNumber(Left([date],1))+19)+Substring([date],1,2)+"-"+Substring([date],3,2)+"-"+Right([date],2))

 

StellaBon
11 - Bolide

Thanks!