Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Getting a date part and adding a time

I have a column that have a Datetime (12/12/2020 16:40:10), what i what is, get the date of this column (12/12/2020) and add another time, (12/12/2020 06:00:00)...
15/12/2020 19:43:00 will become 15/12/2020 06:00:00. 

 

And so on and so forth

 

Is there anyway to do it without using power query? 
Or power query will be the best option?

  • Anonymous You can create a new column like below in your table. This will extract the date from the date column and add the time you wish to concatenate

     

    NewDate = DATE(YEAR(date_123[Date]),MONTH(date_123[Date]),DAY(date_123[Date])) & " " & TIME(06,00,00)
     
    After the creating the above column, please change the data type to Date/Time. It will do the job for you.

1 Reply

  • negi007's avatar
    negi007
    Community Champion

    Anonymous You can create a new column like below in your table. This will extract the date from the date column and add the time you wish to concatenate

     

    NewDate = DATE(YEAR(date_123[Date]),MONTH(date_123[Date]),DAY(date_123[Date])) & " " & TIME(06,00,00)
     
    After the creating the above column, please change the data type to Date/Time. It will do the job for you.