Solved

decimal to fraction conversion

Posted on 1998-06-24
1
339 Views
Last Modified: 2008-03-06
I need to convert decimal numbers to fractions in Access 97.
With Excel you can just format the cells is there a way to do it in Access?
0
Comment
Question by:Desrosiers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 6

Accepted Solution

by:
devtha earned 200 total points
ID: 1975715
Function getpart (var As Double)

Dim var1 As String, var2 As String, var3 As String, var4 As String

var1 = Mid$(Str(var), 1, InStr(Str(var), ".") - 1)
var2 = Mid$(Str(var), InStr(Str(var), ".") + 1, 99)

Select Case var2
    Case "2"
        var3 = "1/5"
    Case "25"
        var3 = "1/4"
    Case "33"
        var3 = "1/3"
    Case "4"
        var3 = "2/5"
    Case "5"
        var3 = "1/2"
    Case "6"
        var3 = "3/5"
    Case "66"
        var3 = "2/3"
    Case "75"
        var3 = "3/4"
    Case "8"
        var3 = "4/5"
    Case Else
        Exit Function
End Select
MsgBox var3

End Function

See if this funcion solves your question.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
restore dependent control enabled state on undo 7 29
MS Access Query Question 2 34
Error Sorting a calculated table field control 2 22
Clear Current Value from Combobox 2 25
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question