Thanks ahead of time you’re your expert advice.
Here is the scenario: I have several Queries that finally end up like the following.
Filekey | Date | Last Name | First Name | Sum of dollars | Sum of dollars |
186 |1/1/2007| | testlast| |testfirst| |109.95| |97.50|
I would like to compare the last two columns and make a new table named transactions that stores the following:
Filekey | Date | Last Name | First Name | sum of largest dollars |
186 |1/1/2007| |testlast| |testfirst| |109.95|
7 1438
Why do you need to store the result in a table, why not just use a query.
In either case, you're looking for the iif() function.
Why do you need to store the result in a table, why not just use a query.
In either case, you're looking for the iif() function.
OK Thanks.... I do not really need to store it. I fugure when the transactions get to over 10,000 it would be faster to pull up pree quired data then run a compare iif() statment against all 10,000. Either way can you give me a usage example please.
Thanks!
OK Thanks.... I do not really need to store it. I fugure when the transactions get to over 10,000 it would be faster to pull up pree quired data then run a compare iif() statment against all 10,000. Either way can you give me a usage example please.
Thanks!
Well, the problem with storing it is what happens if the original numbers get changed? You'll end up having to run the make table query over again anyways. You can't expect the numbers to be static once they've been entered and the table's been created. I suppose it's different if you're looking at a static data set but I don't think that's the case here. -
iif(Conditional Statement, Value if True, Value if False)
-
Well, the problem with storing it is what happens if the original numbers get changed? You'll end up having to run the make table query over again anyways. You can't expect the numbers to be static once they've been entered and the table's been created. I suppose it's different if you're looking at a static data set but I don't think that's the case here. -
iif(Conditional Statement, Value if True, Value if False)
-
That makes since and the initial queries that get us to this poing will narrow down the data to a few hundred rechords anyways. I dont believe I have ever used the iif() statment. In the seniro I gave you can yougive me an idea of how I would use this statment ina query please.
Thanks Alot!
would I do - SELECT *
-
from query1
-
where iif(sum1 < sum2, ......
or what should I do?
Please use the code tags.
Not quite, you're looking to create a new column right? -
SELECT *, iif(Sum1 > Sum2, Sum1, Sum2) AS LargestSum
-
FROM SomeQueryContainingSum1AndSum2;
-
Please use the code tags.
Not quite, you're looking to create a new column right? -
SELECT *, iif(Sum1 > Sum2, Sum1, Sum2) AS LargestSum
-
FROM SomeQueryContainingSum1AndSum2;
-
Sorry about the code thing. You are so AWESOME!!!!! It worked great! Thanks so much. I am so amazed someone like me can get this kind of support for free. What can I do to give back?
It's not a problem. Where would any of us be without some help when we start out? If you wish to give back, try answering some of the other user's questions. It's a win/win because I have learned way more from answering questions by testing out my solutions than I have from asking questions.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: ArunPrakash |
last post by:
Hi,
I have 2 tables and each has a text column. When i compared the 2
columns with the LIKE operator i found something strange.
create table test1( var1 text )
create table test2( var1 text )
...
|
by: Odd-R. |
last post by:
I have to lists, A and B, that may, or may not be equal. If they are not
identical, I want the output to be three new lists, X,Y and Z where X has
all the elements that are in A, but not in B, and...
|
by: Dave |
last post by:
Hello
I've created a student database for our program that I also need to
get statistics from. It's in Access 2003.
The statistics would be things like Male-Female percentage, percentage
of...
|
by: Frank |
last post by:
Hello,
Developing an app where the user fills out a sometimes quite lengthy
form of chkboxes, txtboxes, radbtns, etc. User responses are saved to
a mySql db, which the user can later edit.
When...
|
by: lanwrangler |
last post by:
I know it's a long shot but does anyone have any pointers to generic
algorithms - or, even better, Python code - for comparing images and
computing a value for the "difference" between them?
...
|
by: saravanand |
last post by:
Dear All,
I am new to Ms Access and I am doing Product Hierarchy in SAP. I have to check for redundancy of datas from the SAP system and from another file. Difference found in code or description is...
|
by: saravanand |
last post by:
Dear All,
I am new to Ms Access and I am doing Product Hierarchy in SAP. I have to check for redundancy of datas from the SAP system and from another file. Difference found in code or description is...
|
by: Yas |
last post by:
Hello,
I currently have Table1 and View1.
View1 is a query from 2 or 3 tables that works fine on its own.
However in my current query if I try to use it...something like...
SELECT a.col1,...
|
by: sumuka |
last post by:
Hello Everyone,
I'm doing a project in VB 6.0 and i've a flexgrid which contains some numerical values in it's cell now i need to compare these values present in flexgrid with the values in...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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...
| |