Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > SQL Server 2005
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 24th, 2007, 08:15 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

Or, like me... more coffee! ;)

--Jeff Moden
 
Old October 25th, 2007, 02:42 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can use the % 1440 approach if you want to compare two datetimes, and are only concerned about the time part.

Example:
User A logged in 20071017 19:35:00. He also logged in 20071018 19:51:00.

Question:
Did he log in later or earlier on the 18th of November than the 17th of November?

Another solution: For adjactent days, you can just subtract the two dates and see if there are less than 1440 minutes between them. If so, User A logged in later the 18th. If more than 1440 minutes User A logged in earlier on the 18th.

But what if there were more than 1 day, say a week between the two logins?
Now is the time for the % 1440 tool to resque you.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating time Marta Access 0 April 15th, 2008 10:34 PM
calculating time differences vincee SQL Server 2000 6 January 24th, 2006 11:02 AM
Calculating Time elapsed on form load Brendan Bartley Access 0 June 21st, 2005 09:02 AM
Problems with" i=i+1" and calculating time tronnen XSLT 4 June 6th, 2005 04:17 PM
Missing time part while calculating the Delay happygv SQL Language 2 October 29th, 2003 11:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.