sql - Convert time into datetime which returns today's date and time from database -


how can convert time datetime returns today's date , time database?

let's have time in database. 12:30 pm, when use:

convert(datetime, a.start time) 

it returns 1900-01-01 12:30:00.000. there way can today's date?

like :

2013-07-11 12:30:00:000 

select convert(varchar(19), (cast(getdate() date) + cast(tm datetime)), 120)                yourtable 

output: 2013-07-11 12:30:00

check see if matches requirement

chek see sql feedle demo


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -