Can I join a DATE and TIME fields onto a DATE/TIME field?

It always seemed to me it’s easier for the user to input date and time in separate fields. You can use tab to move between them, you can use the calendar to select the date, etc.

However, let’s say you have deadlines and you must order them.

Sorting by date column you won´t be able to see which time is before the other.

Sorting by time you may have times in order, but dates out of order (meaning a deadline of 25/04/2019 17:00 will be sorted as being after a deadline of 26/04/2019 13:00… one day later, but 4 hours before the other deadline.

So, if we need to put all deadlines in order, we would need to create a single DATE/TIME column and join the DATE and the TIME columns.

Can that be done? How?

If I have a DATE/TIME field… and I need to add 4 days, do I just sum “4” to it?

And if I need to add hours?

What if I have a DATE/TIME field but I need to add DAYS but disregarding hours?

Example: got a service order at 24/04/2019 13:30.

It has a deadline of 4 days. That deadline doesn´t end at 28/04/2019 13:30, but at 28/04/2019 23:59:59.

Can that be done?

You can use below syntax and expand it as you need to add days, hours, minutes and seconds to a DateTime value:

[DateTimeColumn] ± "D.HH:MM:SS"

If you have separate date and time fields you can always CONCATENATE them to form a DateTime value:

CONCATENATE([Date]," ",[Time])

OR simply

[Date]&" "&[Time]

You can also make a concatenation conditionally

([Date]+4)&" "&[Time],
TRUE,([Date]+4)&" "&TIME("23:59:00")
TRUE,([Date]+4)&" "&[Time],
([Date]+4)&" "&TIME("23:59:00")

If you want to add hours & minutes to a concatenated datetime value, you can do that with below expression. Let’s assume we will add 4 hours 30 mins

([Date]&" "&[Time]) + "0.04:30:00"