I’m trying to alter a field in an existing database so the person entering data can choose 1 of 3 options, and in another field a date is calculated and inserted. My current database does this with 2 options…the person chooses 6 months or 1 year, and the date 6 months or 1 year beyond is inserted in another field. Here is my current code to do this: PaidThrough: IIf([Member Type]=”6 months”,DateAdd(“m”,6,[Last Paid]),DateAdd(“m”,12,[Last Paid])).
Now I’m adding a 3rd option – 1 month – and I’m not having any success. Here is the closest I’ve come: PaidThrough: IIf([Member Type]=”1 month”,DateAdd(“m”,1,[Last Paid]) or If[Member Type]=”6 months”,DateAdd(“m”,6,[Last Paid]),DateAdd(“m”,12,[Last Paid])) but it says my operators and operands aren’t in order. I’ve tried many different Ifs, elses, or options and none have worked. Any suggestions? I’m thinking I’m missing something simple.
![]() |
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 |
-
Access Expression (Access 97)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Access Expression (Access 97)
- This topic has 12 replies, 6 voices, and was last updated 21 years, 11 months ago.
AuthorTopicWSdeebock
AskWoody LoungerJuly 30, 2003 at 7:36 pm #391270Viewing 1 reply threadAuthorReplies-
WSHansV
AskWoody LoungerJuly 30, 2003 at 7:54 pm #698302 -
WSdeebock
AskWoody Lounger
-
-
WSMarkLiquorman
AskWoody LoungerJuly 31, 2003 at 11:53 am #698531>>Any suggestions? I’m thinking I’m missing something simple.<<
I have a suggestion. Don't store that calculated date in your database! This is a clear violation of database normalization rules. Why not change your MemberType field to an integer (dropping the "months"). Then whenever you need to calculate the PaidThru value, you can do a simple calculation: DateAdd("m",[MemberType],[LastPaid])
-
WSdeebock
AskWoody LoungerJuly 31, 2003 at 12:19 pm #698540Mark,
We’re wondering why you feel this is a violation of database normalization? The field we’re calculating is the expiration date of the member, calculated by what type of member they are and when they paid their membership fee. Only one date is stored at a time and it changes each time they renew their membership. Comments? -
WScharlotte
AskWoody LoungerJuly 31, 2003 at 12:25 pm #698544Do you have the date paid stored? What Mark is talking about is that if you have the date paid stored as well, the storing the expiration date as well is unnecessary because it can always be calculated. If you store only the expiration date, then it is not a violation of normalization.
-
WSdeebock
AskWoody Lounger -
WSMarkLiquorman
AskWoody LoungerJuly 31, 2003 at 11:29 pm #698742It’s easy to overlook the rules, mostly because it is easier to do the calculation on data entry and store the value, rather than having to do it every time. And we all have done this at one time or another for various reasons (some good, some bad). But you just need to recognize when you are storing such calculated data, even if you then make a conscientious decision to go ahead anyway. But keep it quiet, so the normalization police won’t come after you!
-
-
-
WSMarkLiquorman
AskWoody LoungerJuly 31, 2003 at 12:46 pm #698551Because you are storing a value in a field that is derived solely from a calculation involving other fields in the record. The inherent risk is that you must remember to recalculate this field whenever ANY of the underlying fields get changed; and the problem is that fields don’t always get changed via a single form that you can control. There may be multiple forms, update queries, etc. Therefore, the PaidThrough date in your database may not always be correct, whereas deriving it when needed will ALWAYS be correct.
-
WSBat17
AskWoody Lounger -
WSMarkLiquorman
AskWoody LoungerJuly 31, 2003 at 10:09 pm #698733I presume they have stored the DatePaid and the Months. I’m not sure what can change that would alter the calculation of the expiration date? If, for example, they change the number of months (let’s say everybody is getting a free month), then you want the expiration date to change automatically.
-
WSpatt
AskWoody Lounger -
WSMarkLiquorman
AskWoody Lounger
-
-
-
-
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
-
Lost sound after the upgrade to 24H2?
by
Susan Bradley
3 hours, 9 minutes ago -
How to move 10GB of data in C:\ProgramData\Package Cache ?
by
Alex5723
4 hours, 4 minutes ago -
Plugged in 24-7
by
CWBillow
11 hours, 25 minutes ago -
Netflix, Apple, BofA websites hijacked with fake help-desk numbers
by
Nibbled To Death By Ducks
16 hours, 17 minutes ago -
Have Copilot there but not taking over the screen in Word
by
CWBillow
13 hours, 26 minutes ago -
Windows 11 blocks Chrome 137.0.7151.68, 137.0.7151.69
by
Alex5723
2 days, 7 hours ago -
Are Macs immune?
by
Susan Bradley
5 hours, 29 minutes ago -
HP Envy and the Function keys
by
CWBillow
1 day, 15 hours ago -
Microsoft : Removal of unwanted drivers from Windows Update
by
Alex5723
2 days, 18 hours ago -
MacOS 26 beta 1 dropped support for Firewire 400/800
by
Alex5723
2 days, 18 hours ago -
Unable to update to version 22h2
by
04om
3 hours, 12 minutes ago -
Windows 11 Insider Preview Build 26100.4482 (24H2) released to Release Preview
by
joep517
3 days, 2 hours ago -
Windows 11 Insider Preview build 27881 released to Canary
by
joep517
3 days, 2 hours ago -
Very Quarrelsome Taskbar!
by
CWBillow
2 days, 12 hours ago -
Move OneNote Notebook OFF OneDrive and make it local
by
CWBillow
3 days, 15 hours ago -
Microsoft 365 to block file access via legacy auth protocols by default
by
Alex5723
3 days, 4 hours ago -
Is your battery draining?
by
Susan Bradley
3 hours, 49 minutes ago -
The 16-billion-record data breach that no one’s ever heard of
by
Alex5723
3 hours, 50 minutes ago -
Weasel Words Rule Too Many Data Breach Notifications
by
Nibbled To Death By Ducks
3 days, 19 hours ago -
Windows Command Prompt and Powershell will not open as Administrator
by
Gordski
1 day, 5 hours ago -
Intel Management Engine (Intel ME) Security Issue
by
PL1
3 days, 3 hours ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
2 days, 20 hours ago -
National scam day
by
Susan Bradley
2 days, 2 hours ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
2 days, 23 hours ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
4 days, 20 hours ago -
Tools to support internet discussions
by
Kathy Stevens
3 days, 9 hours ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
4 days, 11 hours ago -
AI is good sometimes
by
Susan Bradley
5 days, 3 hours ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
4 days, 17 hours ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
6 days, 3 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.