.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!



Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

Help to get SQL output

Posted By: Santosh     Posted Date: October 13, 2015    Points:5   Category :Sql Server
Hi
Any one help to get below output
SrNo ShiftStartDate ShiftEndDate
1 01-01-2013 25-01-2014
2 26-01-2014 25-09-2015
3 26-09-2015 Getdate()

i am passing fromdate(01-09-2014) and fromdate(20-10-2015)
based on this passing date if any date either fromdate or Todate falling between any Shiftfromdate and Shifttodate then that record should display.

Schenario 1 :
I/P
fromdate(01-09-2014) and fromdate(20-06-2015)
o/t 2 26-01-2014 25-09-2015

Schenario 2 :
I/P
fromdate(01-09-2014) and fromdate(26-09-2015)
o/T
2 26-01-2014 25-09-2015
3 26-09-2015 Getdate()

Schenario 3 :
I/P
fromdate(01-09-2012) and fromdate(01-01-2016)
o/T
1 01-01-2013 25-01-2014
2 26-01-2014 25-09-2015
3 26-09-2015 Getdate()

Thanks
Santosh

Responses
Author: Akhil Raj       [Moderator]      
Posted Date: November 30, 2016     Points: 20   

please confirm you passing 2 dates. Both are From Date or You passing From Data and To Date



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend