none
Sultan RRS feed

  • Question

  • hello

    Sir

    i have 1 tables

    1 table name... GeneralLedger...

                    Fields Name....        ID...Date...Name...Narretion... Lot No/DD No... Debit...Credit...Total

    i need like this Query              1     1/1/2015  ABC   Etc             25-26-27        1000      0          -1000

                                                    2    1/2/2015  BCD   TcE             28-29-30          0        1300          300

                                                    3  1/3/2015    ddd    Exp             195-306         200     0                 100

    Thursday, November 5, 2015 12:46 PM

Answers

  • The Sum is missing. The query should be

    SELECT ID, Date, Name, Narretion, [Lot No/DD No], Debit, Credit, (SELECT Sum(XX.Credit - XX.Debit) FROM GeneralLedger AS XX WHERE XX.ID <= GeneralLedger.ID) AS Total FROM GeneralLedger ORDER BY ID;


    Matthias Kläy, Kläy Computing AG

    • Marked as answer by sultanSoomro Friday, November 6, 2015 11:32 AM
    Friday, November 6, 2015 6:55 AM

All replies

  • Try this --

    SELECT  ID, Date, Name, Narretion, [Lot No/DD No], Debit, Credit, (SELECT  [XX].Debit + [XX].Credit FROM GeneralLedger AS [XX] WHERE [XX].ID <= GeneralLedger.ID) AS Total

    FROM GeneralLedger

    ORDER BY ID;


    Build a little, test a little

    Thursday, November 5, 2015 6:03 PM
  •   at most one record can be returned by this subquery????

    Error

    Friday, November 6, 2015 6:08 AM
  • The Sum is missing. The query should be

    SELECT ID, Date, Name, Narretion, [Lot No/DD No], Debit, Credit, (SELECT Sum(XX.Credit - XX.Debit) FROM GeneralLedger AS XX WHERE XX.ID <= GeneralLedger.ID) AS Total FROM GeneralLedger ORDER BY ID;


    Matthias Kläy, Kläy Computing AG

    • Marked as answer by sultanSoomro Friday, November 6, 2015 11:32 AM
    Friday, November 6, 2015 6:55 AM
  • thank You sir

    Klay  

    now i have 2 tables

    1 table Name :  GeneralLedger

     Fields Name....        ID...Date...Name...Narretion... Lot No/DD No... Debit...Credit...Total

    2 Table Name: SupplierInvoice

    Fields Name....        ID...Date...Name...Narretion... Lot No/DD No... Bales...Weight...Mounds...Rate..Amount..Tax...Lding...Credit

    i Want Combine to table like this please ??

    (It's Invoice+GV)

      ID..Date..Name..Narretion..Lot No/DD No..Bales..Weight..Mounds...Rate..Amount..Tax...Lding...Debit...Credit...Total

      1..1/1/15.. Klay..Invoice... 1-2(Days)      200..  30000...803.7... 5500...4420748...44207...2000...0...4378541...0.00

      1..5/1/15...Sultan...DD....   123456.   ........................................................................................................5000000.............5000000

     Not: please my Weight.. Auto /37.324=Mounds....My Mounds *Rate=Amount..My Amount /100=Tax..My Amount-Tax+Lding=Credit...my Debit or Credit plus or minus with preview balance.... Thank You  

    Friday, November 6, 2015 12:22 PM
  • hmmmmmm I think its Hard Q
    Friday, November 6, 2015 3:15 PM