troubleshooting Question

SQL Trigger for DateDiff

Avatar of MimUK
MimUK asked on
Microsoft SQL Server 2005
4 Comments1 Solution1458 ViewsLast Modified:
I have 2 fields
comm_datetime and comm_todatetime in a table called Communication.

I simply need to work out the difference in hours as a decimal (1.5 being 1 and a half hours) between the two.

comm_datetime in the SQL database is '16/12/2008 16:08:12'
comm_todatetime in the SQL database is '16/12/2008 16:18:22'

I simply need a field called comm_allocated to be set to 10

This needs to work as trigger on insert or update

Many thanks for your suggestions
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros