Results 1 to 4 of 4
  1. #1
    Join Date
    May 2003
    Location
    Pinoy in NJ
    Posts
    104

    Question Unanswered: T-SQL How to..??

    Is it possible to show this result

    **** DESIRED RESULT ***
    -1
    0
    0
    0
    **********************

    instead of this actual result
    **** ACTUAL RESULT ***
    -1
    6
    13
    6
    **********************

    I used this query:

    Code:
    select DateDiff(Day,VRUServiceDate,EndDate) from workorder
    I basically want to change all positive values equal to zero.

    Thanks

  2. #2
    Join Date
    Jan 2003
    Location
    Midwest
    Posts
    138
    Code:
    if(value > 0) then
       newValue = 0
    end if

  3. #3
    Join Date
    Jul 2003
    Location
    Tampa, FL
    Posts
    10

    Re: T-SQL How to..??

    You can use this code:

    Code:
    select ( CASE
           WHEN DateDiff(Day,VRUServiceDate,EndDate) <> -1 THEN 0
           ELSE -1
           END ) AS Results
    from workorder

  4. #4
    Join Date
    May 2003
    Location
    Pinoy in NJ
    Posts
    104

    Thumbs up

    Thank you both for the inputs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •