Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Using CASE in WHERE clause

    Try this code

     

    declare @chargeCust varchar(50)

    set @chargeCust = 'test001'

     

    select top 5

    dj.job_no

    , dj.cust_cd

    , dj.job_date_time

    , dj.dlv_reqd_datetime_last

    from daily_job dj

    where

    dj.job_date_time >getdate-7 and

    ((len(@chargeCust) > 0 and dj.cust_cd in (@chargeCust)) or (len(@chargeCust) = 0...

Viewing post 1 (of 1 total)