Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

SQL Case

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQL Case

    In your SELECT CASE.... and WHERE clauses CDE has not matched selection criteria: '100','200', '300' and '00100', '00802'... If '00100', '00802'.. is not CDE, but another field CDEXX use temporary table method as shown in example. This SQL applies only to predefined (hardcoded) CDE values '100','200', '300'. I am not sure if you could use sofcoding to get result within only one SQL statement.
    Code

  • #2
    SQL Case

    Oooops.. Apparently in my example Customer field is missing in select clause.
    Code

    Comment


    • #3
      SQL Case

      There was little mistyping in my code. I tried your code but still it is not working. The correct code is below The Operational Navigator SQL Editor does not give any errors (strange)
      Code

      Comment


      • #4
        SQL Case

        If you will take close look at both codes, the difference is your new selection criteria and field names. My code was tested and it worked fine.

        Comment


        • #5
          SQL Case

          Hi, The Code Below is working Fine but I need little more refinement. It shows four column at the end FileDate, CustomerID, Act , Red I want to show some more columns based on the country. Suppose there is only two country US/CAN. FileDate, CustomerID, CanAct, CanRed, USAct, USRed Is it possible to show like that? Thanks
          Code

          Comment


          • #6
            SQL Case

            Hi, I am stuck with this SQL Sum/Case Problem. Kindly help. I need a cross tab solutions as in MS. Access Data is like
             Customer Code Amount ======= ==== ====== 12345 100 50 12345 100 55 12345 200 100 12345 200 100 12345 200 100 12345 300 300 11111 100 200 11111 200 500 11111 300 300 11111 300 300 
            Result should be like that
             Customer R100 R200 R300 ================================= 12345 105.00 300.00 300.00 11111 100.00 500.00 600.00 
            Kindly guide Thanks
            Code

            Comment

            Working...
            X