SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 add two date in sql
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

amirs
Constraint Violating Yak Guru

India
259 Posts

Posted - 11/01/2010 :  01:51:23  Show Profile  Reply with Quote
how to add two date in select query in sql

like
select date1 + date2 from tbl

ricky_1605
Starting Member

India
30 Posts

Posted - 11/01/2010 :  02:17:40  Show Profile  Reply with Quote
Assuming date1 and date2 are columns of a table and of same datatype.

select date1 + date2 from <table> where <condition>

Nipun Chawla
Go to Top of Page

vaibhavktiwari83
Aged Yak Warrior

India
840 Posts

Posted - 11/01/2010 :  02:55:38  Show Profile  Reply with Quote
What is the significance to add two dates ?


Vaibhav T

To walk FAST walk ALONE
To walk FAR walk TOGETHER
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30106 Posts

Posted - 11/01/2010 :  04:47:57  Show Profile  Visit SwePeso's Homepage  Reply with Quote
What is your expected result of adding '20100101' and '20090101'?
Are you trying to accomplish something else, like getting an average of two dates?



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000