473,385 Members | 1,642 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

#Error, nested IIf

3
Hi

Brand new to Access 2003 and stumbling at the first hurdle. I want a data base which will inform the user when a new task needs to be carried out. I have a column headed "Last Use" (date format, manually entered into table), a column headed, "Frequency" (text format, manually entered into table) and I need a column which will calculate the column Next Use (date format, to be calculated). Entries under "Frequency" should only be "Monthly" or "weekly" but if neither I would like a warning. I figure if I convert the text to a number and then add this to my "Last Use" field it would give me my "Next Use"

I have set a query up "Next Use: IIf([Frequency]="monthly",31,(IIf([Frequency]="weekly",7,"input error"))). But I get #Error if Frequency is anything other than Monthly or Weekly.

Appreciate any assistance.

ajak
May 6 '08 #1
5 1940
NeoPa
32,556 Expert Mod 16PB
Ajak, You may want to check out Normalisation and Table structures. It explains why storing calculated fields is rarely a good idea.

Instead, consider calculating them when required. In a query generally.

However you choose to do it, consider using the DateAdd() function. It's very flexible and should do what you need.
May 6 '08 #2
ajak
3
Ajak, You may want to check out Normalisation and Table structures. It explains why storing calculated fields is rarely a good idea.

Instead, consider calculating them when required. In a query generally.

However you choose to do it, consider using the DateAdd() function. It's very flexible and should do what you need.
Thank you for your reply NeoPa. It looks like the DateAdd() is what I was trying to achieve but, if my limited understanding is correct, the Frequency needs to be turned from a text to a number to allow the DatAdd() to work and this is where I am having my problem. I will check out the suggested Normalisation and Table structures link in greater detail.

I appreciate you taking the time to post a reply.

ajak
May 6 '08 #3
NeoPa
32,556 Expert Mod 16PB
I certainly would check it out, but it won't help you with use of the function.

If you have any questions on that you can post them here and I'll help where I can.
May 6 '08 #4
ajak
3
I certainly would check it out, but it won't help you with use of the function.

If you have any questions on that you can post them here and I'll help where I can.
Thanks NeoPa. I appreciate the offer. Think I will have to go back to the drawing board.

Kind regards

ajak
May 7 '08 #5
NeoPa
32,556 Expert Mod 16PB
Ajak, It sounds to me (I may be mistaken of course) that you're almost there with the DateAdd() function. I would check that out in Help and I doubt you'll be too far short. Any clarifications required can be posted in here.
May 8 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Enos Meroka | last post by:
Hallo, I am a student doing my project in the university.. I have been trying to compile the program using HP -UX aCC compiler, however I keep on getting the following errors. ...
3
by: Luis Diego Fallas | last post by:
Hi everyone , I'm having a problem when trying to compile code that contains the following pattern: using System; public class A { public class B : Inn.C { }
4
by: Lambuz | last post by:
When an HTTP 500.100 occure in IIS 5.0, I was getting redirected to a HTTP 500.100 - 'page cannot be displayed' error page when there was an error, but now in IIS 6.0, I get 'Microsoft VBScript...
12
by: sam | last post by:
hi all, i'm starting to put together a program to simulate the performance of an investment portfolio in a monte carlo manner doing x thousand iterations and extracting data from the results. ...
7
by: The|Godfather | last post by:
Hi everybody, I read Scotte Meyer's "Effective C++" book twice and I know that he mentioned something specific about constructors and destructors that was related to the following...
4
by: rach | last post by:
I just started to learn C++. I copied the following code from a data structure textbook to a ".h" file and couldn't compile it. The code contains three template interfaces. One inherits another. The...
2
by: kavyak | last post by:
This is not a mere error. because,whatever input i give from jsp, its getting updated in mysql but the page is showing some internal error.The error looks like this.Plz tell me if someone knows the...
12
kirara
by: kirara | last post by:
Hello, I am new to rmi and linux enviroment, I have been trying to test this code (java) on uinx where there are three machines: -One as a Controller -an execution host - a submitter I...
0
by: rgettman | last post by:
Hello, I'm attempting to use Pro*C to create a nested table and send that data to a stored procedure as a parameter. However, I'm getting a Pro*C compiler error that I'll describe below. I'm...
3
by: ChrisW | last post by:
Hiya, So I have a class that creates threads within it. These threads are a class underneath the parent class. I want to access values in the parent class from the threads while they run. Yet...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.