|
-
May 2nd, 2015, 09:07 AM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|