#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2008
    Posts
    6
    Rep Power
    0

    How to add and print in sql


    Hi
    here is my code it prints data for 1 perticular date.

    instead of it printing
    1
    3
    3
    1
    3
    1
    13
    0
    3
    0
    0
    1
    1
    1
    0
    5

    for whole day
    I want it to add and print the total please help

    Thanks
    here is code

    Code:
    SELECT O_ESBY_SUM.CALLS
          ,O_ESBY_SUM.ROWDATECREATED
      FROM OB.O_ESBY_SUM O_ESBY_SUM
      
      where To_Date(to_char(O_ESBY_SUM.CALLS.ROWDATECREATED, 'DD-MON-YYYY')) = To_Date('?DATE1::?','MM/DD/YYYY')

    it prints this
    for date 4/19/2012
    here is screen shot
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2006
    Posts
    834
    Rep Power
    387

    Talking


    Originally Posted by desis
    Hi
    here is my code it prints data for 1 perticular date.
    ... Etc ...
    I want it to add and print the total please help
    In SQL*Plus try this:
    Code:
    COMP SUM OF o_esby_sum.calls ON REPORT
    BREAK ON REPORT
    SELECT o_esby_sum.calls, o_esby_sum.rowdatecreated
    FROM ob.o_esby_sum o_esby_sum
    WHERE TO_DATE( TO_CHAR( o_esby_sum.calls.rowdatecreated, 'DD-MON-YYYY' ) ) =
            TO_DATE( '?DATE1::?', 'MM/DD/YYYY' );

IMN logo majestic logo threadwatch logo seochat tools logo