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