473,654 Members | 2,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

107 New Member
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 2672
Rabbit
12,516 Recognized Expert Moderator MVP
The iif() syntax is:
Expand|Select|Wrap|Line Numbers
  1. iif(expression, value if true, value if false)
May 10 '07 #2
buddyr
107 New Member
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 Recognized Expert Moderator MVP
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 New Member
thank you- this should help
May 10 '07 #5
Rabbit
12,516 Recognized Expert Moderator MVP
Good Luck.
May 10 '07 #6

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

Similar topics

7
2114
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 calculation such as *2 I get an incorrect value. For example, if the week number is 11 and I multiply it by 2 I get an answer of 21. How do I convert the displayed week number into an integer value so that I can then perform a calculation on it?
4
3757
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 calculation is very simple. The calculation is done in an underling query if I can call it a query or I should call it a SQL statement. It looks like a query but it is not saved as the query. The calculation in that query is very simple - ExtendedPrice:*....
3
10482
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 regular payrate and hours. Ex: 40.00 hours @ $77.00/hr 5.00 hours @ $102.00/hr If an employee's overtime hours = 0, then the overtime payrate and hours fields should not be visible on the report. Ex: 40.00 hours @ $77.00/hr
4
4987
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 DSum. But these aggregate functions are slowing down the interface and annoying me. So I have decided not to show sub- totals on the form.
2
1691
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 object expressions can be used as a statement
3
1715
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 record to written to the Audit Log. This means that a log entry is created even if users are only scrolling through the records. Is there a way to block a log entry if the only form change is an auto calculation? Thanks in advance.
23
2906
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 in Stock. The SubProducts table is linked to the Product Information table by Item # (and the information is added and viewed as a form Product Information with a Sub Form Sub Products) I have a form (frmInventoryLocation) where a location is...
0
1867
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 same row is true, and - when the boolean field is true, gets its value FROM ANOTHER TABLE? Say we have these two tables: TABLE1
3
2097
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 in the conditional IF statement is only happening against the first value --$link-- in the array --@route-- I want the comparison between the two arrays to repeat for every value in the first array @route. Appreciate any guidance or ideas...
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8482
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8593
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1593
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.