473,500 Members | 1,963 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

due to formula "IIf ( "argue", 'true', 'false')" makes my query slow

17 New Member
One another problem

I have used a formula in the calculated field of a query as -

IIf( [A] <=[b], (IIf([A]<=[C], [A], [C]), (IIf ([b]<=[C], [C], [b]))

the above formula is working properly to give the lowest of [A], [b] and [C] but the problem is that the query is some slow as compared to other query not having such formula. At present, there is only one record in the query to calculate and to show. I fear if what will happen if there will be lots of records.

what to do

can i use - min([A], [b], [C]) - like expression
Sep 14 '06 #1
4 3627
PEB
1,418 Recognized Expert Top Contributor
Strange!

In one record to have slow performance! Expressions like this I use in big tables like 500 000 records and I don't have a big slow down!

Maybe IIF isn't your problem?

:)
Sep 14 '06 #2
mukesh
17 New Member
Strange!

In one record to have slow performance! Expressions like this I use in big tables like 500 000 records and I don't have a big slow down!

Maybe IIF isn't your problem?

:)
I expressed what i felt. Well your post give me confidence on this type of formula. I want to aske whether your table contians - IIf (IIf (IIf())) - type of formula which is complex.
Sep 14 '06 #3
PEB
1,418 Recognized Expert Top Contributor
See this! This returns result no for more than a few seconds! And in the concerned tables / queries there is 30000 - 40000 records!

Expand|Select|Wrap|Line Numbers
  1. SELECT CROSSTAB_NORMS.[0] AS Продукт, arround(IIf([4]="Qty_Piece",Sum([Cadeaux_Commandes01].[Qty])*[CROSSTAB_NORMS].[Qty],Sum([Cadeaux_Commandes01].[Qty])/param_info(show_el_id(16,[1]),0,"COL01N0012")*[CROSSTAB_NORMS].[Qty]),1) AS Result
  2. FROM Cadeaux_Commandes01 INNER JOIN CROSSTAB_NORMS ON Cadeaux_Commandes01.ART = CROSSTAB_NORMS.[1]
  3. WHERE (((CROSSTAB_NORMS.[2])="Conditionnement") AND ((CROSSTAB_NORMS.[3])="Atelier") AND ((IIf(([5] Is Null) Or ([5]="All_markets"),True,IIf(Mid([5],1,2)=Mid([n°Cde],1,2),True,False)))=True))
  4. GROUP BY CROSSTAB_NORMS.[0], CROSSTAB_NORMS.[1], CROSSTAB_NORMS.[4], CROSSTAB_NORMS.Qty;
  5.  
Sep 14 '06 #4
mukesh
17 New Member
See this! This returns result no for more than a few seconds! And in the concerned tables / queries there is 30000 - 40000 records!

Expand|Select|Wrap|Line Numbers
  1. SELECT CROSSTAB_NORMS.[0] AS Продукт, arround(IIf([4]="Qty_Piece",Sum([Cadeaux_Commandes01].[Qty])*[CROSSTAB_NORMS].[Qty],Sum([Cadeaux_Commandes01].[Qty])/param_info(show_el_id(16,[1]),0,"COL01N0012")*[CROSSTAB_NORMS].[Qty]),1) AS Result
  2. FROM Cadeaux_Commandes01 INNER JOIN CROSSTAB_NORMS ON Cadeaux_Commandes01.ART = CROSSTAB_NORMS.[1]
  3. WHERE (((CROSSTAB_NORMS.[2])="Conditionnement") AND ((CROSSTAB_NORMS.[3])="Atelier") AND ((IIf(([5] Is Null) Or ([5]="All_markets"),True,IIf(Mid([5],1,2)=Mid([n°Cde],1,2),True,False)))=True))
  4. GROUP BY CROSSTAB_NORMS.[0], CROSSTAB_NORMS.[1], CROSSTAB_NORMS.[4], CROSSTAB_NORMS.Qty;
  5.  
Oh its amazing. Now I think that time to be taken by MS Access for such type of query is one or two seconds irrespective of the numbers of records. Thanks I will go ahead with this formula. thanks a lot. I will first feed numbers of recods in the table and watch the speed. Thax a lot
Sep 14 '06 #5

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

Similar topics

5
5016
by: Chumley the Walrus | last post by:
When i put an explicit value in the sql statement below as "displaygroup =1 ", i do see my records (or my response.write test after the recordset Open line) appear on my dynamic page. But when use...
2
7511
by: Michelle | last post by:
Hi all, I have a query that scans huge table consists of 8 or more millions records. The funny thing is that if I use the query with local variable, the query takes more than 1 minutes,...
9
2748
by: Ed_No_Spam_Please_Weber | last post by:
Hello All & Thanks in advance for your help! Background: 1) tblT_Documents is the primary parent transaction table that has 10 fields and about 250,000 rows 2) There are 9 child tables with...
5
3558
by: Ellen Manning | last post by:
Using A2K. I have a form with a combo box that runs a query and returns a list of patients. 3 users are sharing this database and the query runs fine for 2 of the users but not the 3rd. The...
0
937
by: innocentchick | last post by:
I have a database that displays the results of my queries in a subform within another form. As soon as I modify the query table and save the changes, the sql code for that query is deleted. For...
2
1443
by: john | last post by:
We have an mdb running on Access 2000 that was originally built in Access 97. Now, after having migrated the mdb to Access 2002 on Citrix (both the mdb and Access reside on the Citrixserver), the...
9
2968
by: Bob Darlington | last post by:
The following query opens slowly the first time it is opened (6-7 seconds), but then is less than one second for the next random number of openings before slowing (6-7 seconds) again. SELECT...
2
1766
by: Ukar | last post by:
my query is slow in testing for quick in production. can any one help
0
7018
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...
0
7182
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,...
0
7232
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6906
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...
0
5490
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4611
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...
0
1430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
316
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...

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.