I have a query as the source of a report which I developed using the design grid… in one of the fields I have the following code :Process Point: IIf([Cams_Change_Data1]![STATUS_CODE]=”D” Or [Cams_Change_Data1]![STATUS_CODE]=”E” Or [Cams_Change_Data1]![STATUS_CODE]=”O” Or [Cams_Change_Data1]![STATUS_CODE]=”P” Or [Cams_Change_Data1]![STATUS_CODE]=”S”,”At EB”,IIf([Cams_Change_Data1]![STATUS_CODE]=”F” Or [Cams_Change_Data1]![STATUS_CODE]=”G” Or [Cams_Change_Data1]![STATUS_CODE]=”H” Or [Cams_Change_Data1]![STATUS_CODE]=”I” Or [Cams_Change_Data1]![STATUS_CODE]=”J” Or [Cams_Change_Data1]![STATUS_CODE]=”L” Or [Cams_Change_Data1]![STATUS_CODE]=”M” Or [Cams_Change_Data1]![STATUS_CODE]=”R” Or [Cams_Change_Data1]![STATUS_CODE]=”W” Or [Cams_Change_Data1]![STATUS_CODE]=”X” Or [Cams_Change_Data1]![STATUS_CODE]=”Y” Or [Cams_Change_Data1]![STATUS_CODE]=”Z”,”AT SUPSHIP”,IIf([Cams_Change_Data1]![STATUS_CODE]=”A” Or [Cams_Change_Data1]![STATUS_CODE]=”B” Or [Cams_Change_Data1]![STATUS_CODE]=”C” Or [Cams_Change_Data1]![STATUS_CODE]=”Q” Or [Cams_Change_Data1]![STATUS_CODE]=”V” Or [Cams_Change_Data1]![STATUS_CODE]=”K”,”IN 400″,IIf([Cams_Change_Data1]![STATUS_CODE]=”N”,”IN NEGOTIAIONS”,”UNSOLICITED”))))which with other query requirements causes it to exceed the 1024 character limitthe entire SQL for this query should look like the following:SELECT IIf(Left$([NEGOTIATOR_CODE],3) Between “420” And “429”,”420 – NEW CONSTRUCTION”,IIf(Left$([NEGOTIATOR_CODE],3) Between “450” And “459”,”450 – REPAIR”,”460 – DESIGN”)) AS [NEGOTIATOR CODE], Cams_Change_Data1.PIIN_CODE, Cams_Change_Data1.PIIN, Cams_Change_Data1.SOSID_NUM, IIf([Cams_Change_Data1]![STATUS_CODE]=”D” Or [Cams_Change_Data1]![STATUS_CODE]=”E” Or [Cams_Change_Data1]![STATUS_CODE]=”O” Or [Cams_Change_Data1]![STATUS_CODE]=”P” Or [Cams_Change_Data1]![STATUS_CODE]=”S”,”At EB”,IIf([Cams_Change_Data1]![STATUS_CODE]=”F” Or [Cams_Change_Data1]![STATUS_CODE]=”G” Or [Cams_Change_Data1]![STATUS_CODE]=”H” Or [Cams_Change_Data1]![STATUS_CODE]=”I” Or [Cams_Change_Data1]![STATUS_CODE]=”J” Or [Cams_Change_Data1]![STATUS_CODE]=”L” Or [Cams_Change_Data1]![STATUS_CODE]=”M” Or [Cams_Change_Data1]![STATUS_CODE]=”R” Or [Cams_Change_Data1]![STATUS_CODE]=”W” Or [Cams_Change_Data1]![STATUS_CODE]=”X” Or [Cams_Change_Data1]![STATUS_CODE]=”Y” Or [Cams_Change_Data1]![STATUS_CODE]=”Z”,”AT SUPSHIP”,IIf([Cams_Change_Data1]![STATUS_CODE]=”A” Or [Cams_Change_Data1]![STATUS_CODE]=”B” Or [Cams_Change_Data1]![STATUS_CODE]=”C” Or [Cams_Change_Data1]![STATUS_CODE]=”Q” Or [Cams_Change_Data1]![STATUS_CODE]=”V” Or [Cams_Change_Data1]![STATUS_CODE]=”K”,”IN 400″,IIf([Cams_Change_Data1]![STATUS_CODE]=”N”,”IN NEGOTIAIONS”,”UNSOLICITED”)))) AS [Process Point], Cams_Change_Data1.STATUS_CODE, Lookup.[Status Description], Cams_Change_Data1.CHG_REC_VALUE, Abs([Cams_Change_Data1]![CHG_REC_VALUE]) AS [ABS Record Value]FROM Cams_Change_Data1 INNER JOIN Lookup ON Cams_Change_Data1.STATUS_CODE = Lookup.[Status Code]WHERE (((Cams_Change_Data1.STATUS_CODE)”T” And (Cams_Change_Data1.STATUS_CODE)”U”));is there a way to shorten the reference to “[Cams_Change_Data1]![STATUS_CODE]” where it repeats so many times?
![]() |
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 |
-
Number of characters in a cell in the query design grid
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Number of characters in a cell in the query design grid
- This topic has 2 replies, 3 voices, and was last updated 10 years, 1 month ago.
AuthorTopicWSmcneilkm
AskWoody LoungerApril 8, 2015 at 11:11 am #499387Viewing 1 reply threadAuthorReplies-
WBell
AskWoody_MVP -
WSMarkLiquorman
AskWoody LoungerApril 8, 2015 at 3:11 pm #1499153I don’t think you can use IN in that situation.
Rather than nested IIF statements, I think you should investigate the Switch function. It is much easier to use and read than all those nested IIFs.
However, why not create function to handle this? That opens up all sorts of options (like using Select-Case, etc.) that will be a lot easier to read and change later (if necessary).
Viewing 1 reply thread -

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
-
Which antivirus apps and VPNs are the most secure in 2025?
by
B. Livingston
29 minutes ago -
Stay connected anywhere
by
Peter Deegan
4 hours, 32 minutes ago -
Copilot, under the table
by
Will Fastie
1 hour, 4 minutes ago -
The Windows experience
by
Will Fastie
1 hour, 18 minutes ago -
A tale of two operating systems
by
Susan Bradley
3 hours, 17 minutes ago -
Microsoft : Resolving Blue Screen errors in Windows
by
Alex5723
6 hours, 38 minutes ago -
Where’s the cache today?
by
Up2you2
21 hours, 58 minutes ago -
Ascension says recent data breach affects over 430,000 patients
by
Nibbled To Death By Ducks
14 hours, 44 minutes ago -
Nintendo Switch 2 has a remote killing switch
by
Alex5723
5 hours, 43 minutes ago -
Blocking Search (on task bar) from going to web
by
HenryW
22 hours, 40 minutes ago -
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
1 day, 15 hours ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
1 day, 15 hours ago -
regarding april update and may update
by
heybengbeng
1 day, 16 hours ago -
MS Passkey
by
pmruzicka
18 hours, 45 minutes ago -
Can’t make Opera my default browser
by
bmeacham
2 days ago -
*Some settings are managed by your organization
by
rlowe44
1 day, 11 hours ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
1 day, 23 hours ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
2 days, 19 hours ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
3 days, 4 hours ago -
AI slop
by
Susan Bradley
22 hours ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
3 days, 5 hours ago -
Two blank icons
by
CR2
13 hours, 33 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
15 hours, 31 minutes ago -
End of 10
by
Alex5723
3 days, 16 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
2 days, 14 hours ago -
test post
by
gtd12345
3 days, 22 hours ago -
Privacy and the Real ID
by
Susan Bradley
3 days, 13 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
1 day, 15 hours ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
4 days, 3 hours ago -
Upgrading from Win 10
by
WSjcgc50
2 days, 15 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.