473,320 Members | 2,083 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.

Using MOD to see if numbers divisble by 6

I have a column with numbers and I need to see if they're divisible by 6. If not, I need to increment them until they are. I'm using the MOD command with 2 fields, Field4 which contains my numbers and Field5 which I want to put the results. I'm using =Iif(Field4 MOD 6 = 0, Field4, 6 - (Field4 MOD 6) + Field4) in an update query in the 'Update to' part of Field5 but I get a "Data type mismatch in expression criteria" error. Any advise?
Aug 18 '11 #1
4 2132
Rabbit
12,516 Expert Mod 8TB
I would double check that both field4 and field5 are int or long data types.
Aug 18 '11 #2
There's not an option for int or long. Both fields are set to number, though.
Aug 18 '11 #3
Rabbit
12,516 Expert Mod 8TB
You need to look at the field size. Access calls it "field size" but that's the real data type. Byte should work also, I think single might work. The other data types won't work though.
Aug 18 '11 #4
NeoPa
32,556 Expert Mod 16PB
Will Tyler:
There's not an option for int or long. Both fields are set to number, though.
I would suggest you look a bit harder Will, before explaining to an expert that they are wrong. It is indeed possible to set or view the number type if you look further down the screen where the details of each field are held.

I tried to look at this for you but so much is unclear that I expect I'd just be wasting time. Why don't you post the SQL of your query using Copy/Paste and we will have a much clearer idea of what you're struggling with (See When Posting (VBA or SQL) Code).
Aug 19 '11 #5

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

Similar topics

0
by: Jason | last post by:
Currently I have a number of html forms which loop through records in a database table. In order to be able to update the right record when the form is submitted, I've tacked number on to the...
4
by: Nathan Sokalski | last post by:
I am using the Folder.Files collection to display all the images in a given directory. The following shows the code I use to create and use this collection: Set...
1
by: Klaasjan Mors | last post by:
Hi, I have the following problem. In a datetimepicker i want to enter only using numbers. eg. date 01-12-2003 Now you have to use a arrowkey after 01 and 12 I want to continu automatic after...
9
by: Marc | last post by:
Okay, here's the problem - I have 3 radio buttons, and 11 check boxes (which are disabled by default). I have the javascript below which when the last radio button is clicked, enables the...
4
by: John Goche | last post by:
Hello, I was wondering what the pros and cons are for using numbers in templates rather than in constructors as in: MyBuffer<10foo; rather than MyBuffer foo(10);
6
by: devoreband | last post by:
hey i wrote all my code but i need to print out only the even numbers so is there any predefined function i can use or what can structure i should be following? ........ 16 for(int r = 0;...
13
by: Peter Oliphant | last post by:
I would like to be able to create a random number generator that produces evenly distributed random numbers up to given number. For example, I would like to pick a random number less than 100000,...
3
by: jervin32189 | last post by:
Hello, I am interested in designing a program that is optimized for touch-screen systems. But I don't know how to code a command button to enter text. This is necessary for like login screens...
4
by: Astley Le Jasper | last post by:
I've been getting errors recently when using pysqlite. I've declared the table columns as real numbers to 2 decimal places (I'm dealing with money), but when doing division on two numbers that...
1
by: davidindy | last post by:
Using VB 2008 w/SQLexpress database I have 2 related tables, (Customers and Efficiency) that I'm trying to pull a number from a field in the customers form and do some math with it on the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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...
1
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.