Results 1 to 3 of 3

Thread: top urgent, i need help

  1. #1
    Join Date
    Jul 2010
    Posts
    1

    top urgent, i need help

    hi for all programmers, please i was made sql project but a am faced many problems the problims is (i have table contens of 3 rows credit,debit,total) i want the row of total show the result of credit-debit so i was wrote this query (select credit,debit,(credit)-(debit) as total.
    this code was succsess to show the result, but i want to make this row show automaticly this function and contain this function not wrtite this code every time whene i want it.
    please answer me A.S.A.P
    regards

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Do you use sql server? Can you post table schema, sample data and expected result?

  3. #3
    Join Date
    Sep 2005
    Posts
    168
    ALTER TABLE myschema.mytable ADD total AS (ISNULL(credit, 0) - ISNULL(debit,0))


    --HTH--

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •