Case Condition not working

I am trying to create a calculation based on the following case condition. For some reason its working fine on a existing report but now when I am creating a new report based on this, its giving error "Invalid Combinations of Condition and Calculations" any thoughts?
I have also found out that when I am adding "ELSE" in the condition then only it's throwing that error otherwise working fine. I have also tried to recreate this case condition in my select statement and tested in TOAD and it runs without a problem.
CASE WHEN ( Reference Date < TO_DATE(:Date) ) AND ( Support Start Date > TO_DATE(:Date) ) THEN TO_DATE(:Date) ELSE Reference Date END

Try to wrap the "AND" and re-select the items into
the case since it looks like the " are missing.
CASE WHEN ( "Reference Date" < TO_DATE(:Date) AND
"Support Start Date" > TO_DATE(:Date) ) THEN
TO_DATE(:Date) ELSE "Reference Date" ENDTried that too but no luck :(. As I said before the same condition is working fine in another existing similar report. I am working on some changes in the existing report and when I am putting this condition it just throws this error message.
Message was edited by:
DiscoverDiscoverer

Similar Messages

  • False/True Case is not working. Please Help!

    Dear all,
    I attached my block diagram, one attachment refers to true case and the other refers to false case.
    My program runs like this: when i run the vi , after homing the motor (there is home.vi), DAQ is collecting the values in the while loop, and according to the DAQ's value, motor should run the False/True case but it does not
    As a result: true/false case is not working which is located at the outside of the loop(bottom side of the block diagram)
    When i put the the True/false inside the Loop(DAQ's loop) , then it is working. But this brings lots of problem, two of them is: 
    1-) When the DAQ values goes below to "50" then it turns to true case again,
    2-) The false case has stop.vi which cause to motor stop every iteration of the loop.
    So that is why i put True/False case out of the loop but now it is not working at all.
    Please answer, waiting response.
    Thank you,
    Have a nice day,
    Kind Regards.
    Attachments:
    OutloopTrueMode.pdf ‏432 KB
    OutofLoopNotWorking.pdf ‏443 KB

    Salander wrote:
    Dear GerdW,
    Thank you for reply, You can see my answers written with red.
    "As long as the case structure is located outside the loop it will not be called before the loop stops. THINK DATAFLOW!"
    - The case structure need to run same time with the loop, because as you can see from the attachments the case structure is also integrated with DAQ values.. loop is continuous till i press the stop button.  So what i understand that this case structure will not work because loop is continuous?? Cant we upgrade the vi. or do smthg that it can be able to work same time with the loop??
    Kind Regards.
    You have to place the case structure inside the while loop ( Any significance is there on placing the case outside the loop? ).
    Salander wrote:
    Dear GerdW,
    Btw. it would be much more useful to attach real pictures or, even better, the VI...
    Because most of the people dont have my "motor controller's labview drivers"  I attached as a PDF file which is very popular.
    Not Really * .png file ( vi snippet ) is much more popular here in Discussion Forum
    The best solution is the one you find it by yourself

  • OR condition not working correctly in SQL

    I am adding the folling condition to a sql statement and
    AND (status_code IS NULL or status_code <> 'T'
    or (status_code IN ('A','B','C','D') and TRIM(order_type) NOT LIKE '%9999')
    or (status_code IN ('A','B','C','D') and order_type IS NOT NULL)
    or (status_code NOT IN ('A','B','C','D')))
    but the or condition work...
    if i change it too
    AND ( (status_code IN ('A','B','C','D') and order_type IS NOT NULL) )
    then this portion of the OR condition work but when I use the OR condition something weird is happening that the condition not working... and i dont see a record that meets that condition...

    Hi,
    It's not the "trim" that implies "not null", but rather the fact that:
    - "not like" operator works only on non-null values and
    - "not like" operator disregards null values.
    Consider this:
    test@ORA92>
    test@ORA92>
    test@ORA92> l
      1  with x as (
      2    select null as y from dual union all
      3    select 'a9999' from dual union all
      4    select 'bxx' from dual
      5  )
      6  select * from x
      7* where y not like '%9999'
    test@ORA92>
    test@ORA92> /
    Y
    bxx
    1 row selected.
    test@ORA92>
    test@ORA92>Here, trim function was not used, but still the first row (that had null for y) was not returned. That's because Oracle disregarded the first row for comparison and out of the next two rows, it returned the third row because it satisfied the condition.
    As for your query, do the following conditions hold true:
    1. if status_code is null      - show the row regardless of order_type
    2. if status_code <> 'T'       - show the row regardless of order_type
    3. if status_code in (a,b,c,d) and order_type is not null and order_type ends with something other than 9999 - show the row
    4. if status_code in (a,b,c,d) and order_type is null                           - do not show the row
    5. if status_code in (a,b,c,d) and order_type is not null and it ends with 9999 - do not show the row
    6. if status_code is anything other than (a,b,c,d)                              - do not show the rowpratz

  • Condition not working if Part Number is not included in result

    Good day
    Please assist with the following?
    A user wants to display a summary of values for different key figures on all Parts belonging to certain vehicle categories. One of the key figures (KF1) must only display values > (greater than) u20180u2019. He does not want the Part number to display in the report, but KF1 must be based on the individual values of the parts, example if Part V001 has amounts u201C-R200.00u201D, u201CR10.00u201D and R20.00u201D, the summary total to be displayed in the result must = u201CR30.00u201D. (u201C-R200.00u201D must not be included)
    I have created a condition on this key figure (KF1) where I indicated the value > 0. When I run the query, the condition does not work on the summary of data, it still includes the values < (smaller than) u20180u2019.
    Is there a way I can display the correct values?
    Thanks in advance.
    Cj

    I am not sure if I understood your problem correctly. But to me seems like your problem can be solved at aggregates. I didnt understand your problem correctly, but let me put some pieces together and see of that helps you.
    Lets say you have 3 different KFs.
    KF1__KF2__KF3
    -200__10___20
    100___20___20
    Now if you create a fourth KF (CKF), you dont want to consider the negative values of KF1. Meanging CKF should display 30 and NOT -190.
    If that is the case for KF1, only, you can create one CKF1 which will calculate either 0 (if KF1 value is less than 0) or the KF1 value (if KF1 value is > 0). After this, your scenario will be,
    CKF1 = (KF1 > 0)*KF1+0
    KF1__CKF1_KF2__KF3
    -200____0____10___20
    100__100_____20___20
    After that create second CKF2 to sum CKF1 + KF2 + KF1
    KF1__CKF1__KF2__KF3__CKF2
    -200_____0___10___20____30
    100____100___20___20____140
    Now if your problem is that if part is not part of query result, you sitll want to perform this calculation at part level. In that case, you can create an exception aggregation for CKF2 as part level. So, even if part no is not in query, the calculation will be performed at part no level.
    - Dhaval.

  • IF-condition not working in sap script??????

    hi,
       i am trying to chk one condition in sap script using if statement....but it is not working at all.
      statement i am writing is :-
    /:   IF &IST_ITEM-SAD_PRINT& <>  0
    p7 ,,,,,,,,,,,,,,,,SAD,, 4.00  &IST_ITEM-SAD_PRINT&
    /:   ENDIF
    value for IST_ITEM-SAD_PRINT is coming as it is shown while debuging .
    eventhen control is going inside if statement independent from the value of IST_ITEM-SAD_PRINT
    how to use if statement properly....
    regards
    Deepak

    Hi,
    Declare a dummy variable of type IST_ITEM-SAD_PRINT and then use that variable in sapscript..
    Ex..
    <b>Print program</b>
    DATA: V_DUMMY LIKE IST_ITEM-SAD_PRINT.
    <b>Sap script</b>
    /: IF &IST_ITEM-SAD_PRINT& <> <b>&V_DUMMY&</b>
    p7 ,,,,,,,,,,,,,,,,SAD,, 4.00 &IST_ITEM-SAD_PRINT&
    /: ENDIF
    Thanks,
    Naren

  • Custom Pricing Conditions not working for a PO in SRM

    Hi Experts,
    We are on SRM 5.0, ECC 6.0 , Extended Classic Scenario.
    We configured the pricing conditions in SRM . We defined the our custom pricing condition types as below
    Condition type      ---  Condition Class       ---  Calculation Type
    Frieght(%)            ---       Prices                ---      Percentage
    Frieght Value       ---        Prices                ---  Fixed Amount
    We also defined the Calculation Schema.
    But when we try to define the pricing conditions in SRM during PO creation\change , the standard pricing condition types work but when we input the above defined custom pricing condition type, the value entered gets cleared. Pricing Overview is not calculating the values of the custom Pricing condition types.
    Please assist as where i have gone wrong. Do I need to run any standard report for pricing or do i have to implement any BADI.
    Thanks,
    Addy.

    Hi Sanjeev,
    I have run SM52 and VMC is active with 4 VM's .
    Please suggest.
    Thanks,
    Addy.
    Edited by: Addy1209 on Nov 18, 2010 4:28 PM

  • Count (case when) not working in sql

    Hi All,
    I am trying to find the count of members for a perticular date range, it seems not working correclty.
    Could any one help me out.
    here is the query...I am getting same output for all the cases..please help
    Select
    t
    .MemberNbr,t.patcom
    count(case
    when
    datediff(d,
    mbrs.DischargeDate,
    convert(datetime,convert(varchar(12),t.specificdateofservice),112))
    between
    -1
    and
    -365
    then t.MemberNbr
    else 0
    end)as
    edvisits365daysprior
    count(case
    when
    datediff(d,
    mbrs.DischargeDate,
    convert(datetime,convert(varchar(12),t.specificdateofservice),112))
    between 1
    and 3
    then t.MemberNbr
    else 0
    end)as
    edvisits3Days
    count(case
    when
    datediff(d,
    mbrs.DischargeDate,
    convert(datetime,convert(varchar(12),t.specificdateofservice),112))
    between 1
    and 30
    then t.MemberNbr
    else 0
    end)as
    edvisits30Days
    count(case
    when
    datediff(d,
    mbrs.DischargeDate,
    convert(datetime,convert(varchar(12),t.specificdateofservice),112))
    between 1
    and 60
    then t.MemberNbr
    else 0
    end)as
    edvisits60Days
    count(case
    when
    datediff(d,
    mbrs.DischargeDate,
    convert(datetime,convert(varchar(12),t.specificdateofservice),112))
    between 1
    and 90
    then t.MemberNbr
    else 0
    end)as
    edvisits90Days
    --,*--membernbr,specificdateofservice,count( membernbr)--, specificdateofservice)as visitcount--, patcom
    --Into #Tmp_PPCSEDCnt1
    From
    stg_tbl_InPatientPrepost Mbrs
    join
    #Tmp_MCCSEDVisits t
    on
    mbrs.MemberNbr=t.MemberNbr
    --where UPPER(t.MR_Line_Desc) in ('FOP EMERGENCY ROOM - HOSPITAL', 'FOP EMERGENCY ROOM Urgent Care',
    --'PROF ER VISITS AND OBSERVATION CARE')
    group
    by t.MemberNbr,t.patcom

    You may replace 0 as NULL and see how it works for you?
    eg:
    count(case when datediff(d, mbrs.DischargeDate,
    convert(datetime,convert(varchar(12),t.specificdateofservice),112)) 
    between -1 and -365 thent.MemberNbr else NULL end)as edvisits365daysprior

  • CAS SSO not working for VPN Group

    Hello,
    I am trying to get SSO working for a CAS/CAM in a inband virtual gateway for VPN users coming in off a ASA5520. There are two VPN groups each with its own group policy and tunnel group. One group uses a Windows IAS Radius Server and the other a token based RADIUS RSA device.
    Users use the AnyConnect client to connect to the ASA where they are dumped into a vlan. SSO works for the group that uses the Winodws radius server. On the CAS the Cisco VPN Auth server has the Unauthenticated Group as the default group, and then I use mapping rules (Framed_IP_Address) to get the different vpn groups into the right roles. This works for the one group, but since SSO is not working on the second group the CAS never gets the chance to assign them into the correct role.
    The only thing I got is this from the ASA:
    AAA Marking RADIUS server billybob in aaa-server group cas_accounting as ACTIVE
    AAA Marking RADIUS server billybob in aaa-server group cas_accounting as FAILED
    I am so close but cant call this done yet....

    Hey Faisel,
    Thanks for the question.
    This is the stange thing. For days Group A (Windows Radius Server) was working and Group B (RSA Radius Server)  would not work. Then for some reason I had to reboot the CAS and BOOM...Group B started working and Group A STOPPED working.
    So on the ASA I now get these:
    AAA Marking RADIUS server cas2-hvn-3515 in aaa-server group cas_accounting2 as ACTIVE
    AAA Marking RADIUS server cas2-hvn-3515 in aaa-server group cas_accounting2 as FAILED
    Where cas_accounting2 is the AAA server group for Group A
    On the ASA I can see that the FW sends a packet to the cas:
    "send pkt cas2-hvn-3515/1813"
    but the FW never gets an answer back from the CAS for Group A whereas with Group B I can see the response from the CAS.
    "rad_vrfy() : response message verified"
    What can I look for in the CAS logs to see where the problem is. I will try and setup a packet capture on the CAS and debug it too.

  • BPEl Human Activity Issue - Reject case is not working

    Hi All,
    I have bpel processs. It is works like this:
    It has a human task for approval from manager with ACCEPT or REJECT as outcomes.
    Once the manager Accepts the request, the initiator (say applicant) should get a email updating the status as accepted.
    And when the request is rejected by manager, then the initiator(say applicant) should get an email updating the status.
    The problem is the human activity is working fine for ACCEPT and sending email. But struck up for REJECT outcome. It is waiting for task completion from manager, i mean completion of human activity even though it is completed as the manager rejected it.
    Audit activity log when Human activity got REJECTed by manager:
    *"waiting for "onTaskCompleted" from "TaskService". Asynchronous callback"*
    I tried the below things.
    1) Deleted the task form --> saved the process --> closed Jdev --Re-opened  JDev and created a new task form. Still the same behavior. Not working for REJECT case.
    Can some body help me in figuring out the issue.
    I am using SOA suite 10.1.3.1 n JDev 10.1.3.1
    Thanks,

    Hi,
    I could figure out the solution to the problem.
    The issue was with xquery. I build it wrongly. I could find this from my domain logs.Then I corrected the query. Now it is working fine.
    Thanks,
    Irfan khan

  • Condition not working

    Hi all the is code i have used
    DECLARE     
         CURRENTRECORD NUMBER;     
    BEGIN
    DECLARE
                   CURRENT_DISCOUNT NUMBER;
                   CURRENT_REASON VARCHAR2(100);
    BEGIN
    CURRENT_DISCOUNT:=:XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE;
                   CURRENT_REASON:=:XXSY_DISCOUNT_MANAGER_V.DISCOUNT_REASON;     
                   CURRENTRECORD :=:SYSTEM.CURSOR_RECORD;
                   IF :XXSY_DISCOUNT_MANAGER_V.DISCOUNT = 'Y' THEN
                   FIRST_RECORD;
                   WHILE TRUE LOOP
              :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE:= CURRENT_DISCOUNT;
              :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_REASON:= CURRENT_REASON;
                   IF :System.Last_Record = 'TRUE' THEN     
              :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE:=CURRENT_DISCOUNT;
              :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_REASON:=CURRENT_REASON;
    EXIT;
    ELSE
         NEXT_RECORD;
    END IF;
    END LOOP;
    END IF;                
         END;
    END;
    it is not working properly,for record to record values is changing.for 1st record it is ok ,2nd record itis dispalying 1st record like that..
    plss help me in this condition
    Rgards
    Siva

    DECLARE
    CURRENTRECORD NUMBER;
    CURRENT_DISCOUNT NUMBER;
    CURRENT_REASON VARCHAR2(100);
    BEGIN
    CURRENT_DISCOUNT:=:XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE;
    CURRENT_REASON:=:XXSY_DISCOUNT_MANAGER_V.DISCOUNT_REASON;
    CURRENTRECORD :=:SYSTEM.CURSOR_RECORD;
    IF :XXSY_DISCOUNT_MANAGER_V.DISCOUNT = 'Y' THEN
    FIRST_RECORD;
    LOOP
    :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE:= CURRENT_DISCOUNT;
    :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_REASON:= CURRENT_REASON;
    EXIT WHEN :SYSTEM.LAST_RECORD='TRUE';
    NEXT_RECORD;
    END LOOP;
    END IF;
    END;
    Is the condition ":XXSY_DISCOUNT_MANAGER_V.DISCOUNT " true for more than 1 record....??????
    Is there any error....?????
    Are there displayed in your block more than one record...?????
    Transform the above code and execute it in sql plus..... as db procedure..... Are the results as expected....?????
    Greetings,
    Simon

  • ** XPath condition not work well in Receiver Determination.

    Hi,
    My scenario is having 3 receivers. I have 'Student' is the data type. I use the same data type for Source & Target Message Types. Requirement is I have to send
    1) only records which are having SCOURSE = 'BE' to receiver 1
    2) only records which are having SCOURSE = 'MCA' to receiver 2
    3) only records which are having SCOURSE = 'MBA' to receiver 3
    My Input.xml file contains the following records.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:THIRD_MT_OB xmlns:ns0="http://ganesh_third">
       <STUDENT_INFO>
          <ST_ID>10020</ST_ID>
          <SNAME>Raja</SNAME>
          <SCOURSE>BE</SCOURSE>
          <SFEES>3000</SFEES>
          <SMARKS>1200</SMARKS>
       </STUDENT_INFO>
       <STUDENT_INFO>
          <ST_ID>10021</ST_ID>
          <SNAME>Ram</SNAME>
          <SCOURSE>MCA</SCOURSE>
          <SFEES>3000</SFEES>
          <SMARKS>1200</SMARKS>
       </STUDENT_INFO>
       <STUDENT_INFO>
          <ST_ID>10022</ST_ID>
          <SNAME>Ram</SNAME>
          <SCOURSE>MBA</SCOURSE>
          <SFEES>3000</SFEES>
          <SMARKS>1200</SMARKS>
       </STUDENT_INFO>
    </ns0:THIRD_MT_OB>
    I set the Xpath condition in the Receiver Determination Step and add the 3 receivers for against the conditions.
    Our problem is, If we send the single record in the input file, the corresponding receiver is selected correctly and we get the output file for that receiver. But, if we send the all combination of records (MCA,BE,MBA) 3 receivers are selected and the 3 output files we get. But, the three files are having the all records (MCA,BE,MBA). Instead, we want the first file should only have MCA record,  the 2nd file should only have BE record and finally the 3rd file should only have MBA record. That means each receiver should receive only one record for the above input.
    Friends, I though it will work for the 'XPath Expression' against receivers in the Receiver Determination Step. But, it didn't work. (Records are not split up)
    How do achieve this, friends?
    Could you kindly help me to solve this problem.
    Kind Regards,
    Jeg P.

    If you are trying to split you input msg and send it  to 3 different receivers using conditional receiver determination then it will not work. Once a condition is meet in the receiver determination then the entire msg is forwarded to the corresponding receiver, that is why when you have a single row in your input file which results in a single msg in XI the conditional receiver works. Now when you have multiple rows in your input file still only one msg is being created in XI for all the rows currently so all the conditions are being meet and the msg is forwarded to all the receivers.
    If you are using FCC in the sender side then use the "recordset per msg" parameter to consider each row of your input file as a separate msg in XI and the rest will automatically fall in place.
    Cheer's

  • Receiver Determination-Condition not working

    Hi all,
    It is simple iDoc to File scenario.  I have two receivers based on a condition in the receiver determination.  I am getting all data into both receivers without executing the condition. 
    Below is the condition.  Any idea why this is not being executed?  Thanks for your help.
    (/ZGENERIC_OUTBOUND01/IDOC/Z1GENERIC_SDATA/SDATA = '1C')
    (/ZGENERIC_OUTBOUND01/IDOC/Z1GENERIC_SDATA/SDATA = '1B')

    >   <?xml version="1.0" encoding="UTF-8" ?>
    > - <ZGENERIC_OUTBOUND01>
    > - <IDOC BEGIN="1">
    > - <EDI_DC40 SEGMENT="1">
    >   <TABNAM>EDI_DC40</TABNAM>
    >  ......
    >  ......
    >   </EDI_DC40>
    > - <Z1GENERIC_SDATA SEGMENT="1">
    >        <SDATA>1C</SDATA>
    >   </Z1GENERIC_SDATA>
    > - <Z1GENERIC_SDATA SEGMENT="1">
    >        <SDATA>1C</SDATA>
    >   </Z1GENERIC_SDATA>
    > - <Z1GENERIC_SDATA SEGMENT="1">
    >        <SDATA>1B</SDATA>
    >   </Z1GENERIC_SDATA>
    >   </IDOC>
    >   </ZGENERIC_OUTBOUND01>
    You cannot have both the conditions in same IDOC at the same time. Like here in the above example you have 1C & 1B both, so in this situation it will not work.
    Just for testing either remove 1C or 1B and then test. I am sure it will work.
    You cannot send the same payload at the same time based on two different conditions to 2 different receivers except you put 'OR' in your conditon for 1C & 1B. But in this situation message will go to both of the receivers which you don't want here.
    Regards,
    Sarvesh

  • "If"  condition not working

    Hi all,
    Here i want to put condition like when BELRT field of BKPF table get 'RE' type data this time condition is fire and program will termineted. for this i put code like below.
    SELECT * FROM BKPF INTO TABLE IT_BKPF WHERE BELNR IN P_DOCNO          " DOCUMENT NO.
                                            AND   GJAHR IN P_FYEAR.         " FISCAL YEAR.
        if it_bkpf-blart = 'RE'.
          MESSAGE 'Please Enter Correct Doc.No and Financial Year' TYPE 'I'.
          SUBMIT ZFI_MM_DEBIT_VENDOR1 VIA SELECTION-SCREEN AND RETURN.
          LEAVE PROGRAM.
        endif.
    But it will not working. So please help me out..
    Thanks in Advance.
    keyur chauhan
    Code Formatted by: Alvaro Tejada Galindo on Jan 4, 2010 5:28 PM

    please correct you code
    SELECT * FROM BKPF
    INTO TABLE IT_BKPF
    WHERE BELNR IN P_DOCNO    and                  " DOCUMENT NO.
               GJAHR IN P_FYEAR    and               " FISCAL YEAR.
                blart  ='RE'.
    if sy-subrc = 0.
    "  do what ever you want here further processsing
    else.
       message 'No Data Found' type 'I'.
       LEAVE-LIST PROCESSING.
    ENDIF.
    ( or )
    SELECT * FROM BKPF
    INTO TABLE IT_BKPF
    WHERE BELNR IN P_DOCNO    and                  " DOCUMENT NO.
               GJAHR IN P_FYEAR .                            " FISCAL YEAR
    if sy-subrc = 0.
       loop at it_bkpf in wa_bkpf.
          if wa_bkpf-blart = 'RE'.
              "  Do you logic what you want
         else.
       "   here you can do many things
         "     a) use CONTINUE statment to move to next loop pass
           "   b) you can raise an  message
         endif.
    Let me know if you need further information
    Regards
    Satish Boguda

  • Case tatement not working within a cursor

    I am having a problem getting the case statement to work within a cursor in a store procedure in our 2008 r2 environment. Below is the cursor that I'm referring too. Any suggestions would be greatly appreciated.
    SET NOCOUNT ON;
    DECLARE @part_id as int, @WAREHOUSE_ID AS varchar(80), @SAFETY_STOCK_QTY AS int;
    DECLARE parts_cursor CURSOR FOR
    select part_id ,WAREHOUSE_ID,  coalesce(SAFETY_STOCK_QTY,0) from PART_WAREHOUSE where Part_ID in (SELECT distinct  #FLINES03.Part from #FLINES03)
    OPEN parts_cursor
    FETCH NEXT FROM parts_cursor
    INTO @part_id, @WAREHOUSE_ID, @SAFETY_STOCK_QTY
    WHILE @@FETCH_STATUS = 0
    BEGIN
      CASE @WAREHOUSE_ID
        WHEN 'AAA' THEN UPDATE #FLINES03 SET WHS1_SS_QTY = @SAFETY_STOCK_QTY WHERE #FLINES03.PART = @part_id AND #FLINES03.WHS1 = @WAREHOUSE_ID
        WHEN 'BBB'THEN UPDATE #FLINES03 SET WHS2_SS_QTY = @SAFETY_STOCK_QTY WHERE #FLINES03.PART = @part_id AND #FLINES03.WHS2 = @WAREHOUSE_ID
        WHEN 'CCC'      THEN UPDATE #FLINES03 SET WHS3_SS_QTY = @SAFETY_STOCK_QTY WHERE #FLINES03.PART = @part_id AND #FLINES03.WHS3 = @WAREHOUSE_ID 
      END   
      FETCH NEXT FROM parts_cursor INTO @part_id, @WAREHOUSE_ID, @SAFETY_STOCK_QTY
    END
    CLOSE parts_cursor
    DEALLOCATE parts_cursor

    CASE is an expression, not a statement. It means you can not execute code. You need to change your code to IF statements, e.g.
    IF @WAREHOUSE_ID = 'AAA'
        UPDATE ....
    IF 
        UPDATE ...
    Also, what is the purpose of using cursor? Can you provide the whole picture of what you're trying to achieve?
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • MDX simple case statement not working?

    hi all - any idea what is wrong with this MDX statement? it is returning blank. I am trying to add a calculated measure using the below code but it is not working. thanks for the help.
    CASE WHEN [Accounts].[Account Name].CURRENTMEMBER = "Cash" THEN
    ([Dates].[Hierarchy].currentMember.lastChild, [Measures].[Measures].[Amount]) END

    If you are checking for the 'Cash' member of the Account Name hierarchy, do you need to do something like this?
    CASE WHEN [Accounts].[Account Name].CURRENTMEMBER IS [Accounts].[Account Name].[Cash] THEN([Dates].[Hierarchy].currentMember.lastChild, [Measures].[Measures].[Amount]) END
    Regards,
    MrHH

Maybe you are looking for

  • Why can't I sign up to eprint? HP Deskjet 3050 All in one J611 series

    Website will not let me register my HP Deskjet 3050 All in one J611 series for e-print

  • Slow render times with large jpegs - complete system lag

    In a project i'm working on I have two large jpegs with a small zoom scaling effect. Going from 100 to 103 percent. I've noticed that both Adobe Media Encoder and Premiere Pro experience a heavy slow down in render time as soon as the jpegs have to b

  • Reporting Point BackFlush

    Gurus, Pl. Let me know, where to insert Reporting Points in the Product Cost Collectors?. I have got a message that, either i should indicate reporting point in the routing or in the product cost collectors. (Routing i belive it is milestone control

  • Problem with String Parameter in Command

    I'm running CR XI. I have a report that I want to change the command to use a parameter rather than an hard-coded number that I used for testing. The text of the SQL is: select j.instrument_type,j.cost_type_cd,j.customer,j.bs, j.product,j.del_pd, j.b

  • Pages don't open--site hangups?

    I am using 10.4.6 on a mac-mini, Safari, and my internet connecton is dial-up through Draytek external modem (my only choice). I have noticed for some time that after I have been on the net for awhile, and visited 5-10 sites, the pages will begin to