Access 2000 and fractions

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

As far as I can tell Access is not able to display fractions other than as
text. I have a number of fields that are product dimensions. I have to be
able to sort these by size which I can do as a decimal. Problem arises when
I produce printed materials for customers who are used to seeing these sizes
as fractions.

Does anyone know how I can do this other than using two fields for each
dimension (the decimal & the fraction in a text field).

Brian
 
I'd recommend keeping your product dimensions as number types with decimals.
Later, when you need to run a report or product printed materials for
customers, you can use a function named FractionIT(), courtesy of Access MVP
Arvin Meyer. Here is a link to the source code for it:

http://tinyurl.com/2w5hx


hth,
 
Well, if you have one field for the integer value, and one
for the fraction:

intNumber txtFraction
1 1/2
2 3/4
1 5/8


You could:

Select intNumber & " " & txtFraction as NewFraction From
Table1 order By intNumber + Eval(txtFraction)


Otherwise, you'd either save it as 1+1/2 or write a
function to split it and convert fraction to decimal.


Chris Nebinger
 
Brian,

Fractions by nature are always text! A fraction consists of a numeral, a
division symbol and another numeral (ie, 1/2). Since there is always the
division symbol and it being non-numeric, the only way a fraction can be
displayed is as text. Therefore, since you want to sort your product dimensions
and display the dimensions as fractions, you need these tables:

TblFractions
DecimalValue
Fraction

TblProduct
ProductID
ProductName

TblDimension
Dimension

TblProductDimension
ProductDimensionID
ProductID
Dimension
DecimalValue

TblFractions would have records that look like:
..125 1/8
..25 1/4
..5 1/2

TblDimension would have the records:
Width
Height
Depth

You would join DecimalValue in TblFraction to DecimalValue in
TblProductDimension, Dimension in TblDimension to Dimension in
TblProductDimension and ProductID in TblProduct to ProductID in
TblProductDimension.

For data entry you need a form/subform where the main form is based on
TblProduct and the subform is based on TblProductDimension.
 
Back
Top