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 want to take a column called TicketOpenDateTime and a column called HistoryFirstResponse and use them in a DATEDIFF function to find out the time difference between when the ticket was opened and when the First Response was entered into the system. I need synatx help with this please.
dinakar
Master Smack Fu Yak Hacker
2507 Posts
Posted - 2009-09-17 : 15:42:34
did you try books on line? If you have some code and are getting an error please post and someone can helpDinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/
JVisconti
Starting Member
47 Posts
Posted - 2009-09-17 : 16:13:47
I have this piece of code:SELECT ResponseTime = HistoryFirstResponse-TicketOpenDateTime, TicketOpenDateTime, HistoryFirstResponseFROM ( select TicketOpenDateTime = convert(datetime,'20090916 23:59:00.000'), HistoryFirstResponse = convert(datetime,'20090917 12:00:00.000') )aThis places the information I am looking for in a new table when I want it to show as a new column in the same table as the data I'm looking through.
Lamprey
Master Smack Fu Yak Hacker
4614 Posts
Posted - 2009-09-17 : 16:41:40
I'm not sure I'm clear, but are you looking for something like the DATEDIFF function?