1 Reply Latest reply on Apr 23, 2012 6:39 AM by Ahmed Ahmed

    Custom Sql Guidelines

    Ahmed Ahmed

      Hi All,

       

      To implement certain complex requirements in terms of display, I have to write a custom Sql. The underlying database is Sql Serve 2008r. The following query is giving error whereas it runs fine on Sql and give the correct result.

       

      Can any body guide me on that?

       

      Select




      L1.LedgerAccount, L1.SubLedger, L1.[ LedgerAccountDescription     ],



      L2.LedgerAccount, L2.SubLedger, L2.[ LedgerAccountDescription     ]
      From
      COA L1 ,COA L2


      Where
      cast(L1.LedgerAccount as varchar(20))+'0' = LEFT(cast(L2.LedgerAccount as varchar(20)),2)
      And

      L1.SubLedger IN (80)
      And

      L2.SubLedger IN (70)

       

       

      Regards,

       

      Obaid.