I want to use an IIF statement in my access query, but Excel will not allow me to import the query data because it doesn’t recognize an IIF. Can you suggest an alternative? 2003, BTW.
![]() |
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 |
-
IIF stmt does not allow query from Excel
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » IIF stmt does not allow query from Excel
- This topic has 10 replies, 4 voices, and was last updated 15 years ago.
AuthorTopicWScchambers@work
AskWoody LoungerMay 24, 2010 at 1:46 pm #469099Viewing 9 reply threadsAuthorReplies-
WBell
AskWoody_MVPMay 24, 2010 at 2:17 pm #1225396I’m not sure how you are trying to import the query data into Excel, but if you export it to Excel from Access it should work just fine. Simply right-click on your saved query, and choose Export and specify an Excel file time and it should get you what you are after. And the IIF statment won’t show up in your data – I do this regularly.
-
WScchambers@work
AskWoody Lounger -
WSjeremybarker
AskWoody Lounger -
WScchambers@work
AskWoody LoungerMay 25, 2010 at 11:26 am #1225524Aaaahhhhhhhaaaaaa!!!!!
Thank you for catching that. I was so fixed on the IIF statement that I didn’t cross validate my remaining formulas. I found that it was linked to these 2:
GRP_TRIM: Trim(StrReverse([Full Name]))
GRP: StrReverse(Trim(Left([GRP_TRIM],InStr([GRP_TRIM],” “)-1)))
I’m doing that because i have a field in [Full Name] where we have manipulated the data. we had nowhere else to put a “type” so we jury-rigged the name field to show it. any idea what to do here to give me a field that will reflect the type(grp) shown at the end of the name? thanks!!!!
John S. Doe VENDOR
John S. Doe CLIENT
John S. Doe EMPLOYEE
John S. Doe 12/31/2011 -
WScchambers@work
AskWoody Lounger -
WSkentg
AskWoody LoungerMay 26, 2010 at 1:01 am #1225577What is the StrReverse function trying to do? It’s not a built in function.
Can you give an example of the contents of the field and what you want it to look like in the output.
You may be able to get what you want using InStrRev([GRP_TRIM],” “) to get the position of the last space and then use Mid() to reassemple the bits you want.
if your [Full Name] is “John S. Doe VENDOR”
Mid([Full Name], InStrRev([Full Name], ” “) + 1)
will result in “VENDOR”
-
WBell
AskWoody_MVPMay 26, 2010 at 9:22 am #1225606StrReverse actually gives you the string backwards – see StrReverse Function – Access …. I think the approach you suggest should work.
-
WScchambers@work
AskWoody LoungerMay 26, 2010 at 11:22 am #1225616StrReverse and StrRev are my actual problem. those expressions aren’t recognized when i’m in excel pull in my data from access. I basically need create fields that would reflect the following for the [FULL NAME] fields shown below. The problem is that this is a free-form text field we are manipulating. I was trying to do a string reverse and take into account any typos or spaces that i know the team will mess up during setup. by doing a reverse, i thought if i put the “type” information first, i could possibly jury-rig it futher to take into account fat-fingering the data. since StrReverse doesn’t play well with excel, is there any other suggestions that you might have?
the formula previously suggested: Mid([Full Name], InStrRev([Full Name], ” “) + 1) returned blanks. it’s right on the tip of the brain, but i just can’t get over the hump. thanks!
VENDOR
CLIENT
EMPLOYEE
12/31/2011John S. Doe VENDOR
John S. Doe CLIENT
John S. Doe EMPLOYEE
John S. Doe 12/31/2011 -
WBell
AskWoody_MVPMay 26, 2010 at 12:51 pm #1225623I think I see the issue – the Mid as Kent typed it only has the starting character, and doesn’t tell you how many to get, so it returns blanks. The function should look like
Mid([Full Name], InStrRev([Full Name], ” “) + 1,25)
The 25 is just a stab at what the maximum length the string following the name might be. You could get cute and calculate it using the Len() and a second InStrRev() function, but the mid will take whatever length you put in there and return only the number of characters that exist. -
WScchambers@work
AskWoody LoungerMay 27, 2010 at 2:49 pm #1225936The problem is that StrReverse, StrRev, and InStrRev do not translate to Excel. So when I have those expressions in my query, excel doesn’t know how to read them. It fails in getting the data out. hhhhhmmmm. i’m really stumped on this one. i think i might just have to leave it without pulling out those fields and deliver it down to excel that way. then, within excel, i’ll write formulas there to pull out the “type” …..that is, unless someone else can think of anything. thanks all for trying!!!!
Viewing 9 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
-
End of support for Windows 10
by
Old enough to know better
28 minutes ago -
What goes on inside an LLM
by
Michael Covington
42 minutes ago -
The risk of remote access
by
Susan Bradley
32 minutes ago -
The cruelest month for many Office users
by
Peter Deegan
2 hours, 43 minutes ago -
Tracking protection and trade-offs in Edge
by
Mary Branscombe
5 hours, 51 minutes ago -
Supreme Court grants DOGE access to confidential Social Security records
by
Alex5723
5 hours, 53 minutes ago -
EaseUS Partition Master free 19.6
by
Alex5723
6 hours, 51 minutes ago -
Microsoft : Edge is better than Chrome
by
Alex5723
19 hours, 9 minutes ago -
The EU launched DNS4EU
by
Alex5723
1 day, 7 hours ago -
Cell Phone vs. Traditional Touchtone Phone over POTS
by
280park
22 hours, 12 minutes ago -
Lost access to all my networked drives (shares) listed in My Computer
by
lwerman
1 day, 13 hours ago -
Set default size for pasted photo to word
by
Cyn
1 day, 19 hours ago -
Dedoimedo tries 24H2…
by
Cybertooth
1 day, 7 hours ago -
Windows 11 Insider Preview build 27871 released to Canary
by
joep517
2 days, 18 hours ago -
Windows 11 ad from Campaign Manager in Windows 10
by
Jim McKenna
11 hours, 4 minutes ago -
Small desktops
by
Susan Bradley
10 hours, 10 minutes ago -
Totally disable Bitlocker
by
CWBillow
1 day, 11 hours ago -
Phishers extract Millions from HMRC accounts..
by
Microfix
2 days, 15 hours ago -
Windows 10 22H2 Update today (5 June) says up-to-date but last was 2025-04
by
Alan_uk
3 days, 22 hours ago -
Thoughts on Malwarebytes Scam Guard for Mobile?
by
opti1
1 day, 17 hours ago -
Mystical Desktop
by
CWBillow
4 days, 1 hour ago -
Meta and Yandex secretly tracked billions of Android users
by
Alex5723
3 days, 6 hours ago -
MS-DEFCON 2: Do you need that update?
by
Susan Bradley
18 hours, 9 minutes ago -
CD/DVD drive is no longer recognized
by
WSCape Sand
4 days, 16 hours ago -
Windows 11 24H2 Default Apps stuck on Edge and Adobe Photoshop
by
MikeBravo
4 days, 19 hours ago -
North Face and Cartier customer data stolen in cyber attacks
by
Alex5723
4 days, 17 hours ago -
What is wrong with simple approach?
by
WSSpoke36
2 days, 15 hours ago -
Microsoft-Backed Builder.ai Set for Bankruptcy After Cash Seized
by
Alex5723
5 days, 5 hours ago -
Location, location, location
by
Susan Bradley
3 days, 19 hours ago -
Cannot get a task to run a restore point
by
CWBillow
5 days, 6 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.