Solved

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

Posted on 2010-11-24
3
321 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 31

Accepted Solution

by:
awking00 earned 500 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
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.​
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…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now