Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 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 January 11th, 2011, 04:59 AM
Registered User
 
Join Date: Jan 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default please help me how to count/convert date into days.

can someone help me how to count/convert the date into days.
my problem is when it comes to year.
when the year are not the same.
can someone help me how to solve this problem

for example.

2010/12/25 - 2011/1/25 = 30days.


thanks.
juric.s
 
Old January 11th, 2011, 12:53 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

SELECT DATEDIFF(dd,'2010-12-25','2011-1-25')

Your choice as to whether to add "1" to that or not.
__________________
--Jeff Moden

Last edited by Jeff Moden; January 22nd, 2011 at 01:01 PM..
 
Old January 21st, 2011, 11:33 PM
Registered User
 
Join Date: Jan 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

THANKS A LOT JEFF
 
Old January 22nd, 2011, 01:02 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

You're very welcome. Thank you for the feedback.
__________________
--Jeff Moden





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to convert date to days teamml SQL Server 2000 3 May 8th, 2007 07:05 AM
Todays date and date of 3 days later Singh591 Visual Basic 2005 Basics 1 December 21st, 2006 06:06 PM
How to calculate a number of days between 2 date windy417 Pro JSP 1 July 20th, 2006 07:09 PM
convert to days khautinh SQL Server 2000 4 September 8th, 2005 02:09 PM
Can't subtract days from a date Please Help Arsi C# 1 January 6th, 2005 03:34 PM





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