Results 1 to 4 of 4

Thread: How to perform arithmetic operations on the database records using vb.net

Threaded View

  1. #2
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: How to perform arithmetic operations on the database records using vb.net

    Yea, the way your tables are setup, you would need a JOIN. You could reevaluate the table structure though and not need it. As you have it, it looks like Table1 has information about a specific train ride including how much it cost. If you where to move the cost of the trip to Table2, then you have a bit more flexibility by allowing different passengers to pay different amounts (kid rate, senior rates, discounts, ect.) In doing so, you would no long need a join, since all of the information is in a single table. Insofar as doing math in SQL you should be able to do something like this...

    Code:
    SELECT (fare * .2) FROM table1 WHERE <someField> = <someValue>
    Last edited by kebo; May 2nd, 2015 at 09:11 AM.
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width