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
 General SQL Server Forums
 New to SQL Server Programming
 Date query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

abhit_kumar
Posting Yak Master

146 Posts

Posted - 09/12/2009 :  07:33:03  Show Profile  Reply with Quote
Hello All friends,

I have some problem in writing stored procedure for date related quereis.

There is two date field which is of mm/dd/yyyy format.

Suppose First date field = 02/21/2008
Second date field = 11/15/2009

Now i want to calculate number of days return based upon the condition as below:-

It will should retrun to split into the number of days in 2008 and the number of days in 2009.

And the number of days return for 2008 should be used for some other calc and number of days return for 2009 should be used for some different calc.

year 2008 period is = 01/01/2008 to 12/31/2008
year 2009 period is = 01/01/2009 to 12/31/2009

Please help me in respect of same.

Thanks,
Abhi

SwePeso
Patron Saint of Lost Yaks

Sweden
30216 Posts

Posted - 09/12/2009 :  07:36:09  Show Profile  Visit SwePeso's Homepage  Reply with Quote
Cross post!
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=132694



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.05 seconds. Powered By: Snitz Forums 2000