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

perform a calculation on a field then a conditional statement between two fields

107 100+
I have one table in microsoft access database.
I need to perform calculation on a field- then a conditional statement between 2 fields.
field2 - needs to be multiplied by 5
the answer needs to be compared to field1.
I have to find out if field2( after multiplication) is less than field1.

then I have to have a report that gives me only the records where this is true.

any ideas about how I can do this?
(am not sure about syntax of IIF statements in access.)
thank you
May 10 '07 #1
5 2651
Rabbit
12,516 Expert Mod 8TB
The iif() syntax is:
Expand|Select|Wrap|Line Numbers
  1. iif(expression, value if true, value if false)
May 10 '07 #2
buddyr
107 100+
I have created a new field with field * 5.
I have created a new field with IIf statement that results in Yes if condition is true.
I then created a make table query.
In the new table I made a query selecting all records that have IIf statement field filled Yes.
From this I am making a report.
Is there anyway anybody would of done it easier.
Seeing as I will have to update this every week with updated data.
thank you
May 10 '07 #3
Rabbit
12,516 Expert Mod 8TB
I have created a new field with field * 5.
I have created a new field with IIf statement that results in Yes if condition is true.
I then created a make table query.
In the new table I made a query selecting all records that have IIf statement field filled Yes.
From this I am making a report.
Is there anyway anybody would of done it easier.
Seeing as I will have to update this every week with updated data.
thank you
You can do everything in the one iif() field. That expression you want to write can be written as one expression and plugged into the first parameter.

There is no need for a make table query and then a seperate query based on that table. It can be done in one query.
May 10 '07 #4
buddyr
107 100+
thank you- this should help
May 10 '07 #5
Rabbit
12,516 Expert Mod 8TB
Good Luck.
May 10 '07 #6

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

Similar topics

7
by: peter | last post by:
I have created a MS Access query where one of the fields displays the week number. The field is a date value that uses the ww format to display the week number. However, when I try to create a...
4
by: vg-mail | last post by:
Hello all, I have identical design for form and report but I am getting calculation error on form and everything is OK on report. The form and report are build up on SQL statement. The...
3
by: smuir | last post by:
I am working with a basic access form for a payroll system and need to modify it such that if an employee worked overtime, then their overtime payrate and hours show up on the report below their...
4
by: wrldruler | last post by:
Hello, First, I know it's against "Access Law" to save calculations in a table, but....I want/need to. I currently have sub-totals being calculated inside a form, using DMax, DCount, and...
2
by: Paul | last post by:
Can you help me with this error? string fields = string.Empty; .... fields.Length 0 ? fields += ", Name" : fields += "Name"; Error: Only assignment, call, increment, decrement, and new...
3
by: FrozenDude | last post by:
I've implemented Allen Browne's Audit Log and it works quite well (thanks). However, my form has a series of calculated fields that fire on the form OnCurrent event. The calculation causes a...
23
klarae99
by: klarae99 | last post by:
In Access 2003 I am creating an Inventory Database from scratch. There are two tables (tblProductInformation and tblSubProducts) that I am trying to use in a queary to determine the number of Items...
0
by: =?Utf-8?B?S3VydCBvZiBTYW4gSm9zZQ==?= | last post by:
All- Please advise as to what's the best way to display data in a column in a grid view (and I'm using a dataset) in a table (say TABLE2) which: - is non-zero only if a boolian field in the...
3
by: hutch75 | last post by:
Question could also be asked, how to compare data between two arrays and perform an action (print cmd) everytime there is a match? The problem I'm having with the code below is that the comparison...
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
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.