Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
i have 2 sql fields - one called thedate one called thetime(both are datetime field)how can i set mydate=the date from the date and the time from thetime
problem is both have a date and time -- and i want to ignore the time by the thedate and ignore the date by thetimeso for exampleDECLARE @thedate datetime, @thetime datetimeSELECT @thedate = '20071029 10:02:12.123', @thetime = '18801010 10:02:12.123'SELECT [@thedate] = @thedate, [@thetime] = @thetime, [Combined] = @thedate + @thetime
Kristen
Test
22859 Posts
Posted - 2007-10-29 : 06:24:34
Please post sample data with your question in future, it saves answer the wrong question