barbarossaii
Master of Disaster
- Local time
- Today, 22:26
- Joined
- Dec 28, 2002
- Messages
- 70
Hi,
got a query which works in a test db, but fails in the real db.
The SQL of the query is:
SELECT a.LG, a.dat, a.[anz-schl-], a.RMNR, a.[PB-DAT], a.STATUS, a.KST, a.E3, a.E4, a.LIEFERANTENNR_8, a.LIEFERANTENNR_9, a.LIEFENAM, a.ARTID, a.ARTIDX, a.ARTDESC1, a.[tech-entsch], a.merkmal1, a.merkmal2, a.merkmal3, a.PA_DAT, a.[anz-gepr-], a.[jahr-]
FROM qry_PB_getr AS a
WHERE (((a.[anz-schl-]) In (Select Top 3 [anz-schl-] from [qry_PB_getr] where [dat]=a.[dat] and [LG]=a.[LG] Order By [anz-schl-] desc)))
ORDER BY a.LG, a.dat, a.[anz-schl-] DESC;
In my test db I based the query on a table named qry_PB_getr, which has about 5000 records; the records are a copy of the results of the query qry_PB_getr in my real db. The SQL-Works in the test db !
When I run the SQL based on my query qry_PB_getr in the real db I get an error message (translated from German => Engl.):
"The Impression was entered wrong, or it is too compex. For example a numeric expression could contain too many complex elements. Simplify it by using variables."
What can I do ?
Thanks in advance,
Barbarossa II
PS: As I need this query just once a month I don't mind the long run time (getting the results on other ways will take more time and requires harder work ;-)
got a query which works in a test db, but fails in the real db.
The SQL of the query is:
SELECT a.LG, a.dat, a.[anz-schl-], a.RMNR, a.[PB-DAT], a.STATUS, a.KST, a.E3, a.E4, a.LIEFERANTENNR_8, a.LIEFERANTENNR_9, a.LIEFENAM, a.ARTID, a.ARTIDX, a.ARTDESC1, a.[tech-entsch], a.merkmal1, a.merkmal2, a.merkmal3, a.PA_DAT, a.[anz-gepr-], a.[jahr-]
FROM qry_PB_getr AS a
WHERE (((a.[anz-schl-]) In (Select Top 3 [anz-schl-] from [qry_PB_getr] where [dat]=a.[dat] and [LG]=a.[LG] Order By [anz-schl-] desc)))
ORDER BY a.LG, a.dat, a.[anz-schl-] DESC;
In my test db I based the query on a table named qry_PB_getr, which has about 5000 records; the records are a copy of the results of the query qry_PB_getr in my real db. The SQL-Works in the test db !
When I run the SQL based on my query qry_PB_getr in the real db I get an error message (translated from German => Engl.):
"The Impression was entered wrong, or it is too compex. For example a numeric expression could contain too many complex elements. Simplify it by using variables."
What can I do ?
Thanks in advance,
Barbarossa II
PS: As I need this query just once a month I don't mind the long run time (getting the results on other ways will take more time and requires harder work ;-)