Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Get decimal part of a number, but store as integer ACCESS 2003 Database

Posted on 2010-11-24
3
Medium Priority
?
334 Views
Last Modified: 2012-05-10
I have a request for a change in recording time from just minutes to minuts and seconds.  The data will be stored in the main table as, say 1.30 minutes, that is one minute and thirty seconds.  On the form, there are two fields, one for minutes and one for seconds.  However, if there is a value in the field already, on the form I want the minute to appear, obviously, in the minute box and the seconds in the seconds box.  I amusing INT to get the interger, but I need to figure out how to get the decimals from the permanent table into the temp table as integer to be stored until they are returned to the permanent table.  that is, 1.30 needs to be in two boxes and if the user updates teh seconds to say 45, then what will be returned to the permanent table is the value 1.45 (on the seconds table, the max value accepted is 59 so keeps the user from inputting what would be considered a minute number)
0
Comment
Question by:ssmith94015
3 Comments
 
LVL 6

Expert Comment

by:ajb2222
ID: 34209477
convert the number to a string
split the string at the decimal point

if this is a macro

      sTempString= Format(str(1.3), "#0.00")
      sseconds =  Right(sTempString, Len(sTempString) - InStr(sTempString, "."))

0
 
LVL 32

Accepted Solution

by:
awking00 earned 2000 total points
ID: 34209487
yourfield mod 1 * 100
1.30 mod 1 = .30 * 100 = 30
0
 

Author Closing Comment

by:ssmith94015
ID: 34209661
Thank you both.  However, I was trying to remember the mod function as I knew there was something that did this.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

971 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