I have a Table with a DateTime field . I want to populate another Field with just the Date. Via SQL How Can I Do this?
UPDATE dbo.[TIOGA$Service Desk]
SET [Resoloution Date] = [Resoloution Date Time]
Below is the field names, how can I write this?
*This post is locked for comments
Thank you for the reply, it was very useful.
I also found this to do the job for me, however it is a worse way of doing it..
UPDATE dbo.[Service Desk]
SET [Resoloution Date] = CONVERT(date, [Resolution Date Time], 3)
WHERE [Resolution Date Time] != '1753-01-01 00:00:00.000'
Hello Lewis,
Before assign you have to convert, see bellow:
SET [Resoloution Date] = CONVERT
(
VARCHAR
(10), [Resoloution Date Time], 111)
NOTE: Based on your format change the last parameter. see the screenshot, HERE GETDATA() returns the current datetime
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156