Link to home
Start Free TrialLog in
Avatar of Marcus Aurelius
Marcus AureliusFlag for United States of America

asked on

How to ADD a DATE field and a TIME field to get a single DATE/TIME field..??

Experts:

My DATE field looks like this:

2008-12-11 00:00:00.000

My Time field looks like this:

1899-12-30 02:59:39.000

I would like to get this into a column:

2008-12-11 02:59:39.000

What is the syntax to use to achieve this in a single column. And yes, just to confirm the TIME field's YEAR is in fact showing 1899...

Thanks
M
ASKER CERTIFIED SOLUTION
Avatar of chapmandew
chapmandew
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Marcus Aurelius

ASKER

This worked:

, cast(convert(varchar(10), mydatefield, 101) + ' ' + convert(varchar(20), mytimefield, 114) as datetime)
 as OrderDateTime

Thanks!