Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)

  • RE: NUll values for input parameters

    You could try this:

    SELECT 1 FROM dbo.tblRoadShowAllocation

    WHERE

    Coalesce(RoadShowID,-1) = Coalesce(@RoadShowID,-1) AND

    Coalesce(RoadShowEventID,-1) = Coalesce(@EventID,-1) AND

    Coalesce(SellerID,-1) = Coalesce(@SellerID,-1) AND

    Coalesce(EmployerID,-1) = Coalesce(@EmployerID,-1)

  • RE: Retrieving stored procedure parameters for modification

    Yes, Using a command object.

    With objCommand

    .Parameters.Item(1).Value = NewValue

    .Parameters.Item(2).Value = NewValue

    .Execute

    End With

  • RE: Move columns to the left if there are NULLs in output

    Select  column1 = coalesce(col1,col2,col3,col4),

      column2 = case  when NonNulls = 1 then NULL

          When NonNulls = 4 then col2

          when NonNulls = 3 then Coalesce(Col3,Col4)

           else Coalesce(col4, col3,col2) end ,

      column3 = case...

  • RE: Where clause based on case

    Range of Dates? If you want to only look at a range of dates in addition to the weekend flags you can append the critiria to the where clause.

    ...and...
  • RE: Where clause based on case

    SELECT count(*) --DATENAME (dw, colDATE)

    FROM tblHolidays

    WHERE

    (CASE WHEN (DATENAME(dw, colDATE) = 'Friday' and @fri_flag = 'Y')

     OR (DATENAME(dw, colDATE) = 'Saturday' and @sat_flag = 'Y')

     OR (DATENAME(dw, colDATE) = 'Sunday' and @sun_flag...

  • RE: Query problem

    You can just run this using the update statement or automate it by adding it as a trigger, as entered below.

     Update PriceName

     set PriceName = Case

      When cast(Price as int)...

Viewing 6 posts - 1 through 6 (of 6 total)