Full Version: Algrebra and Access Functions...
njonsie
This one, I think may be a fun one to figure out. At least I think it will, so I'm posting it.

Concept:

Board Length = 12
Piece Length (mitre cut) = 5
Scrap = 2 ft per 12 board

Easy enough.

So, Board Length/Cut Length = Number of Pieces
12/5=2.4

Only whole numbers are aloud to make complete pieces.

Now if you take the decimal place (.4 off of 2.4) and multipy it by the cut length you get the exact level of scrap.
.4*5=2

If my logic or algreba is flawed please let me know, so I can rethink it.

Is there a way to separate the decimal place from the whole in Access???
balaji
Use \ (that is a backslash instead of / which is a forward slash) to do integer division. 5\2 = 2.
njonsie
Thanks, I don't really understand. I think I'm looking for a way to get the remainder all alone. You've headed me in the right direction though. Thx.
balaji
Well the remainder would be 5/2 - 5\2. Anyways, it looks like you got it figured out. Good luck with your project.
BrianS
Also have a look at the Mod operator in addition to the backslash integer division operator

12 Mod 5 = 2

Pieces = (12/5) = 2 pieces
Scrap = 12 Mod 5 = 2ft
balaji
Brian is right about using the mod operator for remainder. My formula for remainder is wrong. It should be either numerator mod denominator or (numerator/denominator - numerator\denominator)*denominator. Thanks, Brian.
njonsie
I almost forgot, thanks. I had no idea Access was capable of this function!!!!!!!!!!!!!!!!!!!