I have a scenario where I have to match the system time, but I have to match the current time with a pre-set saved datetime variable in sql server.
DECLARE @SyncDate AS DATETIME
DECLARE @SystemDate AS DATETIME
SELECT @SyncDate = dbo.TimeTable.auto_time
FROM dbo.TimeTable
'1900-01-01 03:00
SELECT @SystemDate = GETDATE()
I have to replace the @SyncDate with current date and already saved time, i.e:
2015-11-16 03:00
Any body can help?
Aucun commentaire:
Enregistrer un commentaire