i want to build a calculted field in my query depending on the number of the field afid. For example if Afid = 5 then the calculated field should be 4000000 + [paymentid)
If afid = 2, the calculated field should be 2000000 + [paymentid]
etc etc
How can i build the iif condition in the calculated field ? I am applying the attachement
![]() |
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 in a query (Access 2000)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » IIF in a query (Access 2000)
- This topic has 10 replies, 3 voices, and was last updated 18 years, 3 months ago.
AuthorTopicWSsolar
AskWoody LoungerFebruary 8, 2007 at 11:37 am #439538Viewing 1 reply threadAuthorReplies-
WSMarkLiquorman
AskWoody Lounger -
WSsolar
AskWoody LoungerFebruary 8, 2007 at 1:12 pm #1050585I do not know how to use switch or choose. I know only the IIfcondition. However it gives me an error when i place the condition in the calculated field :
IIF([afid]= 2,2000000+[paymentid],IIF([afid] = 3,5000000+paymentid))
The eror shows that i am missing a bracket.
Could you help me on the basis of my attachement ? -
WSMarkLiquorman
AskWoody LoungerFebruary 8, 2007 at 1:22 pm #1050589
-
-
WSHansV
AskWoody LoungerFebruary 8, 2007 at 1:47 pm #1050596Instead of using a complicated expression, I would add a field Increment to the Affiliates table with the required increment. For afid=5, Increment would be 4000000 etc.
In the query, you can simply use [Increment]+[PaymentID]Note: you should join Affiliates to Customers on afid in the query.
-
WSsolar
AskWoody Lounger -
WSsolar
AskWoody Lounger -
WSHansV
AskWoody LoungerFebruary 8, 2007 at 3:46 pm #1050632Set *all* the joins in the query to option 1.
If you really need the Order Details table in the query, you will have to specify which PaymentID field you want to use in [Increment]+[PaymentID] since both the Orders table and the Order Details table have a field named PaymentID. Depending on what you want, use either [Increment]+[Orders].[PaymentID] or [Increment]+[Order Details].[PaymentID].
-
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
-
MS Passkey
by
pmruzicka
22 minutes ago -
Can’t make Opera my default browser
by
bmeacham
2 hours, 17 minutes ago -
Do not Fall For This Purdentix Scam (Awaiting moderation)
by
elizabethkaur56
8 hours, 15 minutes ago -
*Some settings are managed by your organization
by
rlowe44
10 minutes ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
1 hour, 11 minutes ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
20 hours, 53 minutes ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
1 day, 5 hours ago -
AI slop
by
Susan Bradley
1 day, 5 hours ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
1 day, 7 hours ago -
Two blank icons
by
CR2
16 hours, 43 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
1 day, 16 hours ago -
End of 10
by
Alex5723
1 day, 18 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
16 hours, 39 minutes ago -
test post
by
gtd12345
2 days ago -
Privacy and the Real ID
by
Susan Bradley
1 day, 14 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
1 day, 6 hours ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
2 days, 5 hours ago -
Upgrading from Win 10
by
WSjcgc50
16 hours, 48 minutes ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
20 hours, 22 minutes ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
2 days, 20 hours ago -
The story of Windows Longhorn
by
Cybertooth
2 days, 8 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
2 days, 22 hours ago -
Are manuals extinct?
by
Susan Bradley
8 hours, 20 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
3 days, 7 hours ago -
Network Issue
by
Casey H
2 days, 18 hours ago -
Fedora Linux is now an official WSL distro
by
Alex5723
3 days, 19 hours ago -
May 2025 Office non-Security updates
by
PKCano
3 days, 20 hours ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
3 days, 22 hours ago -
pages print on restart (Win 11 23H2)
by
cyraxote
2 days, 23 hours ago -
Windows 11 Insider Preview build 26200.5581 released to DEV
by
joep517
4 days 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.