Sorry, but you’ll have to post the SQL for the query before anyone can figure out why you get an error.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Parameter Query (97 VR1)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Parameter Query (97 VR1)
- This topic has 5 replies, 2 voices, and was last updated 23 years, 9 months ago.
AuthorTopicWScharlotte
AskWoody LoungerAugust 7, 2001 at 12:31 am #358825Viewing 4 reply threadsAuthorReplies-
WScharlotte
AskWoody LoungerAugust 7, 2001 at 10:27 pm #536456Try this instead. I aliased to two tables to simplify reading the code and to eliminate the need for all those brackets around the table names. Plus alias seem to make the query more efficient. The In operator is also a lot faster than the individual conditions joined by Or.
I’ve seen the “too complex” error before when you use a calculated expression in a where clause without referencing the specific table the field belongs to.
SELECT C.Status, B.[1 Cycle], B.[Batt Date], C.[Cust #], B.[Batt Prepay],
B.BattType, B.NumberofBatteries, [Batt Prepay]-[NumberofBatteries] AS Remaining,
FirstOfMonth([Batt Date],[1 Cycle]) AS BatteryDueDate
FROM [QryCustomerName&Address] AS C
INNER JOIN QryBatteryPlan1 AS P
ON C.[Cust #] = P.[Cust #]
WHERE C.Status In (“Current” , “REFERRAL”, “VET”, “Vet Staff”, “REF.”, “REF..”, “PITA”)
AND B.[Batt Prepay]-B.[NumberofBatteries]>=1
AND FirstOfMonth(B.[Batt Date],[1 Cycle])=[Enter Battery Due Date:]; -
WScharlotte
AskWoody LoungerAugust 7, 2001 at 10:56 pm #536464Aliasing of tables in SQL is just like aliasing a field or an expression. When you have “[Batt Prepay]-[NumberofBatteries] AS Remaining” in your SQL, you’re creating an alias, “Remaining” for the expression “[Batt Prepay]-[NumberofBatteries] “. You alias tables the same way. The alias gives you a handy label to use when referring to the table or expression.
You can do this easily in the query grid itself by opening the properties sheet for one of the tables and changing the alias from the actual table or query name to whatever you want to call it. I usually use 1-letter aliases to keep the SQL more readable. When you do it this way, the query engine will change the SQL to use the new alias instead of the actual table name except in the FROM clause where it *must* know the actual name of the table or query that’s being used.
Try creating a new query using the SQL I posted and see whether that will run. If it works, then just replace the old query with that one.
-
WScharlotte
AskWoody Lounger -
WScharlotte
AskWoody LoungerAugust 9, 2001 at 10:41 pm #536828I think you may be still having reference problems. You should always fully reference the fields in the Where conditions. Try this:
SELECT B.Status, A.[1 Cycle], A.[Batt Date], B.[Cust #], A.[Batt Prepay], A.BattType, A.NumberofBatteries, A.[Batt Prepay]-A.[NumberofBatteries] AS Remaining, FirstOfMonth(A.[Batt Date],[1 Cycle]) AS BatteryDueDate
FROM [QryCustomerName&Address] AS B INNER JOIN QryBatteryPlan1 AS A ON B.[Cust #] = A.[Cust #]
WHERE (((B.Status) In (“Current”,”REFERRAL”,”VET”,”Vet Staff”,”REF.”,”REF..”,”PITA”)) AND ((FirstOfMonth(A.[Batt Date],[1 Cycle]))=[Enter Battery Due Date:]) AND ((A.[Batt Prepay]-A.[NumberofBatteries])>=1)); -
WSPatricia W
AskWoody LoungerAugust 13, 2001 at 2:42 pm #537136I just recently got a variety of error messages including the “Expression is typed incorectly or is too complex ” message involving a date and a parameter (in Access 97). After tracking down a couple of KB that might possibly relate to the problem and tearing my hair out, I finally discovered the problem — BAD DATA. I had tested my query with my test data, but as soon as I imported the _real_ data, the holes in the data appeared. You might look for null data in the field that you are creating the calculated field in your query.
Pat
Viewing 4 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
No HP software folders
by
fpefpe
14 minutes ago -
Which antivirus apps and VPNs are the most secure in 2025?
by
B. Livingston
5 minutes ago -
Stay connected anywhere
by
Peter Deegan
2 hours, 57 minutes ago -
Copilot, under the table
by
Will Fastie
11 minutes ago -
The Windows experience
by
Will Fastie
9 hours, 11 minutes ago -
A tale of two operating systems
by
Susan Bradley
7 minutes ago -
Microsoft : Resolving Blue Screen errors in Windows
by
Alex5723
14 hours, 31 minutes ago -
Where’s the cache today?
by
Up2you2
1 day, 5 hours ago -
Ascension says recent data breach affects over 430,000 patients
by
Nibbled To Death By Ducks
22 hours, 37 minutes ago -
Nintendo Switch 2 has a remote killing switch
by
Alex5723
3 hours, 2 minutes ago -
Blocking Search (on task bar) from going to web
by
HenryW
1 day, 6 hours ago -
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
1 day, 23 hours ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
1 day, 23 hours ago -
regarding april update and may update
by
heybengbeng
2 days ago -
MS Passkey
by
pmruzicka
1 day, 2 hours ago -
Can’t make Opera my default browser
by
bmeacham
2 days, 8 hours ago -
*Some settings are managed by your organization
by
rlowe44
1 day, 19 hours ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
2 days, 7 hours ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
3 days, 2 hours ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
3 days, 11 hours ago -
AI slop
by
Susan Bradley
1 day, 5 hours ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
3 days, 13 hours ago -
Two blank icons
by
CR2
21 hours, 25 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
23 hours, 23 minutes ago -
End of 10
by
Alex5723
4 days ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
2 days, 22 hours ago -
test post
by
gtd12345
4 days, 6 hours ago -
Privacy and the Real ID
by
Susan Bradley
3 days, 20 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
1 day, 23 hours ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
4 days, 11 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.