473,320 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

About Devid

I have a feild named "Net weight" for Kgs. When I devid it with 40. Answer shows in desimal. I wanna spirite stuffs as Mands and kgs. Example as

12100/40= 302.5

But i want that

302 Mands and 20 kgs
Dec 4 '09 #1

✓ answered by Sajid Saeed

I had picked my mistake. Its was a fatal error. Its made very changing. So thanks for it.

5 1429
You can use the Mod operator. This will give you the remainder of the division of any two numbers.
Expand|Select|Wrap|Line Numbers
  1. dim intRemainder as Integer
  2. dim intIntegerPart as Integer
  3.  
  4. intRemainder = 12100 Mod 40
  5. intIntegerPart = 12100 \ 40
intRemainder will now be holding 20 which is the remainder of the calculation.
intIntegerPart will then be holding 302 which is the integer part of the answer, make sure you use the right slash as it is the opposite direction of the normal division symbol.

Hope this helps,
Devo
Dec 4 '09 #2
Thanks for help,

I have used your method. I have found best result. But there is one more problem. When I divide it 12100/40 its shows me mands in decimal. But i wanna that without decimal. As

12100/40= 302.5

But can i get that result in this method

12100 Mod 40 answer looked as 302-20

Please help urgent
Dec 5 '09 #3
ssnaik84
149 100+
I do not know much about MS Access, but, each database or programing language has Ceil and Floor functions..
Ceil - rounds value to upper value e.g. 302.5 => 303 and
Floor - rounds value to lower value e.g. 302.5 => 302

try to use it.. e.g
Expand|Select|Wrap|Line Numbers
  1.  
  2. Floor(12100/40) mands and (((12100/40) - Floor(12100/40)) * 40) kg
  3.  
  4.  
Dec 5 '09 #4
missinglinq
3,532 Expert 2GB
If you'd paid attention to sirdevo's post

"intIntegerPart = 12100 \ 40"

"make sure you use the right slash as it is the opposite direction of the normal division symbol."

perhaps you'd have more success! The right or backward slash, as demonstrated previously, returns the integer part of the calculation without the decimal part!

Linq ;0)>
Dec 5 '09 #5
I had picked my mistake. Its was a fatal error. Its made very changing. So thanks for it.
Dec 6 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: eScrewDotCom | last post by:
eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is very funny. eScrew...
220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
54
by: Brandon J. Van Every | last post by:
I'm realizing I didn't frame my question well. What's ***TOTALLY COMPELLING*** about Ruby over Python? What makes you jump up in your chair and scream "Wow! Ruby has *that*? That is SO...
8
by: eScrewDotCom | last post by:
eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is very funny. eScrew...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
5
by: eScrewDotCom | last post by:
www.eScrew.com eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is...
0
by: eScrewDotCom | last post by:
eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is very funny. eScrew...
7
by: Edward Yang | last post by:
A few days ago I started a thread "I think C# is forcing us to write more (redundant) code" and got many replies (more than what I had expected). But after reading all the replies I think my...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.