Advertisement

07.10.2007 at 09:57AM PDT, ID: 22686490
[x]
Attachment Details

TSQL If Else Code

Asked by BharBhar in SQL Server 2005, MS SQL Server, MS SQL DTS

Tags: else, tsql

I have a table in SQL 2005.

I have 4 columns, all DateTime

in1 out1 in2 out2

---

I want to do this: If any of the preceding values are bigger than the ones after, then the dates change back one day. Time remains the same, but it is minus 1 day.

I think I need some sorta T-SQL.. but don't know where to begin. Any insight is appreciated. Thanks.Start Free Trial
[+][-]07.10.2007 at 10:07AM PDT, ID: 19455693

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.10.2007 at 10:11AM PDT, ID: 19455738

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.10.2007 at 10:11AM PDT, ID: 19455741

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.10.2007 at 10:18AM PDT, ID: 19455814

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.10.2007 at 10:18AM PDT, ID: 19455815

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.10.2007 at 10:19AM PDT, ID: 19455824

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.10.2007 at 10:22AM PDT, ID: 19455857

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Server 2005, MS SQL Server, MS SQL DTS
Tags: else, tsql
Sign Up Now!
Solution Provided By: dqmq
Participating Experts: 5
Solution Grade: A
 
 
[+][-]07.10.2007 at 10:27AM PDT, ID: 19455899

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.10.2007 at 10:09PM PDT, ID: 19460003

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.11.2007 at 11:17AM PDT, ID: 19465173

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32