cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
yanee
Level III

Combine Date Column and Time Column to "DateTime"

Hi,

 

I imported data from the .xls file. There is a "Date" column and "Time" column. I have to create a new column with Date Time Combine.

I used below formula

 

Date MDY( Month( :Date ), Day( :Date ), Year( :Date ) ) + (Hour( :Time ) * 3600 + Minute( :Time ) * 60 + Second( :Time ))

 

Some rows the output is off by roughly 1 minute but some rows are correct.

 

yanee_0-1708059795942.png

 

How Can I fixed this?

3 REPLIES 3
jthi
Super User

Re: Combine Date Column and Time Column to "DateTime"

If your date and time columns are correctly formatted (other has just date and other just time) you should just be able to add them together without any other calculations.

-Jarmo
Thierry_S
Super User

Re: Combine Date Column and Time Column to "DateTime"

Hi,

It seems that there is an easier formula. You can simply define the DateTime column as:

 

:Date + :Time

 

Then, set the format to "m/d/y h:m:s".

This may not solve your problem since the data import from Excel may have odd behaviors, but I would give it a try.

If the problem persists, I would check that the data you imported is valid by converting your Time column to Numeric - Best format and check that the same times are coded by the same number of seconds.

Let us know if it works.

Best

TS

Thierry R. Sornasse
txnelson
Super User

Re: Combine Date Column and Time Column to "DateTime"

You should be able to just add the 2 values together

:date + :time;
Jim