Solved

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

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
2 Access tables, count verbiage used 6 31
How does this SELECT query work 11 99
Need a complete list of ASP.NET page load events 3 25
Update data using formula 22 15
I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
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.​
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

929 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

10 Experts available now in Live!

Get 1:1 Help Now