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 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
-
Uninstalr Updates
by
jv16
8 hours, 5 minutes ago -
Apple zero days for April
by
Susan Bradley
3 hours, 22 minutes ago -
CVE program gets last-minute funding from CISA – and maybe a new home
by
Nibbled To Death By Ducks
8 hours, 53 minutes ago -
Whistleblower describes DOGE IT dept rumpus at America’s labor watchdog
by
Nibbled To Death By Ducks
20 hours, 42 minutes ago -
Seeing BSOD’s on 24H2?
by
Susan Bradley
3 hours, 37 minutes ago -
TUT For Private Llama LLM, Local Installation and Isolated from the Internet.
by
bbearren
11 hours, 6 minutes ago -
Upgrade from Windows 10 to 11
by
Holdsworth8
1 day, 5 hours ago -
Microsoft : AI-powered deception: Emerging fraud threats and countermeasures
by
Alex5723
1 day, 8 hours ago -
0patch
by
WSjcgc50
9 hours, 11 minutes ago -
Devices might encounter blue screen exception with the recent Windows updates
by
Susan Bradley
1 day, 1 hour ago -
Windows 11 Insider Preview Build 22631.5261 (23H2) released to Release Preview
by
joep517
1 day, 11 hours ago -
Problem opening image attachments
by
RobertG
1 day, 12 hours ago -
advice for setting up a new windows computer
by
routtco1001
2 days, 3 hours ago -
It’s Identity Theft Day!
by
Susan Bradley
1 day, 7 hours ago -
Android 15 require minimum 32GB of storage
by
Alex5723
2 days, 8 hours ago -
Mac Mini 2018, iPhone 6s 2015 Are Now Vintage
by
Alex5723
2 days, 8 hours ago -
Hertz says hackers stole customer credit card and driver’s license data
by
Alex5723
2 days, 9 hours ago -
Firefox became sluggish
by
Rick Corbett
1 hour, 19 minutes ago -
Windows 10 Build 19045.5794 (22H2) to Release Preview Channel
by
joep517
2 days, 12 hours ago -
Windows 11 Insider Preview Build 22635.5235 (23H2) released to BETA
by
joep517
2 days, 13 hours ago -
A Funny Thing Happened on the Way to the Forum
by
bbearren
1 day, 10 hours ago -
Download speeds only 0.3Mbps after 24H2 upgrade on WiFi and Ethernet
by
John
7 hours, 38 minutes ago -
T-Mobile 5G Wireless Internet
by
WSmmi16
1 day, 11 hours ago -
Clock missing above calendar in Windows 10
by
WSCape Sand
1 day, 12 hours ago -
Formula to Calculate Q1, Q2, Q3, or Q4 of the Year?
by
WSJon5
3 days, 4 hours ago -
The time has come for AI-generated art
by
Catherine Barrett
2 days, 8 hours ago -
Hackers are using two-factor authentication to infect you
by
B. Livingston
2 days, 17 hours ago -
23 and you
by
Max Stul Oppenheimer
3 days, 1 hour ago -
April’s deluge of patches
by
Susan Bradley
1 day, 5 hours ago -
Windows 11 Windows Updater question
by
Tex265
19 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.