Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Change Int64 to Date Format only for Day

Hi, any idea how I can change an int64 value to a date format? I just want to change the day of the month, which is an integer value in a separate column, to a date format.

 

Thanks!

  • I think you can change the data type of a numeric column to a Date and it should do the conversion. But, the result will depend on the reference date for your source. If you know the reference date you could do this: 

     

    New Date = (DATE(<reference date in year, month, day>) + [Numeric Date]) * 1.

4 Replies

  • Mariusz's avatar
    Mariusz
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

     

    you can use Date.From()

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    LinkedIn

     

  • FrankAT's avatar
    FrankAT
    Icon for Community Champion rankCommunity Champion

    Hi,

    I think you can use the DATE() function like this: DATE(year, month, [Day column])

    or are you looking for something like in the figure?

     

     

    Regards Frank AT

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    I think you can change the data type of a numeric column to a Date and it should do the conversion. But, the result will depend on the reference date for your source. If you know the reference date you could do this: 

     

    New Date = (DATE(<reference date in year, month, day>) + [Numeric Date]) * 1.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Multiple ways have been provided above but can you show some sample data and the expected result you want to us? So that we can check if the solution is work for you.

     

    Best Regards,

    Jay

    Community Support Team _ Jay Wang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.