Solved

decimal to fraction conversion

Posted on 1998-06-24
1
350 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

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

615 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