troubleshooting Question

MSSQL - Choosing between which date is closer to the value in sql

Avatar of Brock
BrockFlag for Canada asked on
Microsoft SQL Server
4 Comments1 Solution446 ViewsLast Modified:
Hello,
Is possible in sql to choose which field date (start or end )  in a record is closer to a particular value ie. July 1, 2013.

Need to compare one date to the next in the record; ie which is the greatest . Then specify the value ie in the where clause (with an or statement)

In general what type of solution is needed.  I am just doing some feedback and working on getting the answer :-).

example:

start date: May 1, 2013
end date : May  2, 2013

Date closes to : July 1, 2013

Thanks,
Nigluc
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros