Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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
    Opinion Zero Sum Game And National Social Fabric Sikh Sikhi Sikhism Dec 25, 2016
    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

  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
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page