Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Sum columns with code?

Discussion in 'Information Technology' started by idta@hotmail.com, Nov 16, 2005.

Tags:
  1. idta@hotmail.com

    idta@hotmail.com
    Expand Collapse
    Guest

    Hi there, I have a table full of numbers. I want to delete all the
    columns that do not have ANY numbers in the rows under the column. I
    assume I could sum the column, and if the sum is 0, I know there are no
    vaules in the column. I then could delete this column and move on to
    the next column.

    Anybody know the commands to sum the column, and proceed to the next
    one (without knowing the name of the next column)? If not, I could
    always hardcode the name of the column and loop it, but that would be a
    nice feature.

    I have a rough idea of how to delete and progress through the table.
    But how do I perform a sum?

    Thanks.
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News In Pictures: Hundreds Of Youngsters Attend Sikh Summer Camp - Slough Express Breaking News Aug 13, 2016
    Sikh News Sikhs On 'The Daily Show' Have Perfect Response For People Who Assume They're Muslim Breaking News Apr 27, 2016
    Opinion "Sikh monument" irks Kenyan Kisumu preachers (UPDATED) Breaking News Feb 8, 2014
    SALDEF Be an Intern in Washington This Summer (SALDEF) Sikh Organisations Dec 18, 2013
    1984 Sikh riots: US court issues summons to Sonia History of Sikhism Sep 6, 2013

  3. Joseph Meehan

    Joseph Meehan
    Expand Collapse
    Guest

    idta@hotmail.com wrote:
    > Hi there, I have a table full of numbers. I want to delete all the
    > columns that do not have ANY numbers in the rows under the column. I
    > assume I could sum the column, and if the sum is 0, I know there are
    > no vaules in the column. I then could delete this column and move on
    > to the next column.
    >
    > Anybody know the commands to sum the column, and proceed to the next
    > one (without knowing the name of the next column)? If not, I could
    > always hardcode the name of the column and loop it, but that would be
    > a nice feature.
    >
    > I have a rough idea of how to delete and progress through the table.
    > But how do I perform a sum?
    >
    > Thanks.


    Do you want to do this on a regular bases or do you have that many
    fields (spreadsheets have columns, databases have fields).

    If you have that many fields it sounds like you need to re-design your
    table(s)

    Consider making a query that sums all fields you are interested in.

    --
    Joseph Meehan

    Dia duit
     
  4. idta@hotmail.com

    idta@hotmail.com
    Expand Collapse
    Guest

    Yes, by default there are that many fields for the user to input
    information.

    I'd prefer to do this via code and not a query because I have many
    fields.

    Thanks.
     
  5. Joseph Meehan

    Joseph Meehan
    Expand Collapse
    Guest

    idta@hotmail.com wrote:
    > Yes, by default there are that many fields for the user to input
    > information.
    >
    > I'd prefer to do this via code and not a query because I have many
    > fields.
    >
    > Thanks.


    When you have many fields (how many is many?) most of the time it is the
    result of poor table design. For example it would generally be incorrect to
    use 31 fields to enter data for each moths activity. Likewise it would
    generally be a bad idea to have 14 fields to enter data about 14 employees.

    This poor table design causes all kinds of problems, not apparent at
    first. It is the way a spreadsheet is constructed, but not the way a
    database should be constructed.

    --
    Joseph Meehan

    Dia duit
     

Share This Page