Hi
I have a date format that is giving me trouble. I have to convert dates into numbers every time.
What I want is an sql that can give me tickets where TIME_WORK_START is today
TIME_WORK_START = '21-07-2009'
This is an eksample that shows all the tickets from now and 250 hours forward.
Thanks
lhg
I have a date format that is giving me trouble. I have to convert dates into numbers every time.
What I want is an sql that can give me tickets where TIME_WORK_START is today
TIME_WORK_START = '21-07-2009'
This is an eksample that shows all the tickets from now and 250 hours forward.
Code:
SELECT ticketid,description,Status,
CONVERT(VARCHAR, DATEADD(ss, TIME_WORK_START - DATEDIFF(ss, GETDATE(), GETUTCDATE()), '1970-01-01 00:00'), 120),
CONVERT(VARCHAR, DATEADD(ss, TIME_PERM__SOLUTION - DATEDIFF(ss, GETDATE(), GETUTCDATE()), '1970-01-01 00:00'), 120)
from SC_Helpdesk
where ticketid in (SELECT ticketid from SC_Helpdesk where status <= 3 and ticket_type = 10 and (CONVERT(int, DATEDIFF(ss, '1970-01-01 00:00', GETDATE()), 120) - CONVERT(int,TIME_WORK_START,120)) between -900000 and 0)
Thanks
lhg