473,440 Members | 1,686 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,440 software developers and data experts.

IIF statements help please

I want to create if statements to arrange days of the week from Monday through Sunday for course list. The day are in this format M for Monday, T for Tuesday etc. I have written 1 statement i.e DAY_OF_WEEK: IIf([CT_MTG.DAYS]='M',"MONDAY") but I need 6 more for the rest of the week! Please help.
Sep 4 '07 #1
6 1880
Rabbit
12,516 Expert Mod 8TB
Create a lookup table instead and join it to that table.
Sep 4 '07 #2
Create a lookup table instead and join it to that table.

I do not understand what a lookup table is and or how it will work. Is that the easier way to do it or the iif statement?
Sep 5 '07 #3
Stwange
126 Expert 100+
The structure of an IIF statement is IIF(boolean test, value if true, value if false). Modify your existing IIF statement to have another IIF statement as the false value.
For example:
Expand|Select|Wrap|Line Numbers
  1. IIf([CT_MTG.DAYS]='M',"MONDAY",IIf([CT_MTG.DAYS]='T', "Tuesday",IIf([CT_MTG.DAYS]='W',"WEDNESDAY")))
etc. I'm not writing the whole thing because it's a simple task, and I'm not sure how you represent the differences between Tuesday/Thursday and Saturday/Sunday with one letter. Good luck.
Sep 5 '07 #4
The structure of an IIF statement is IIF(boolean test, value if true, value if false). Modify your existing IIF statement to have another IIF statement as the false value.
For example:
Expand|Select|Wrap|Line Numbers
  1. IIf([CT_MTG.DAYS]='M',"MONDAY",IIf([CT_MTG.DAYS]='T',"Tuesday",IIf([CT_MTG.DAYS]='W',"WEDNESDAY")))
etc. I'm not writing the whole thing because it's a simple task, and I'm not sure how you represent the differences between Tuesday/Thursday and Saturday/Sunday with one letter. Good luck.

Thanks for the reply. The there are tow column in the table with days. One column (DAYS) has them entered in this format MTWHF(for Mon, Tue, Wed, Thuand Fri), W, H, T H(for Tue and Thur). There is also column for each day by day name eg MON, TUE, WED, THU, FRI, SAT. If a course if taught say on Monday, the column MON has Y and if the same course is taught on Thursday the column THU has a Y, etc.
So when I write the iif statement it is only converting the M on DAYS but if there is also T H W, the iif statement does not convert Wednesday and Thursday. So what should I do so the iif statement can convert the DAYS eg MTWHF to MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY?
Sep 5 '07 #5
Rabbit
12,516 Expert Mod 8TB
Why are you replicating your data? Why have multiple ways of representing the same data?

A lookup table is just a table with two fields (usually). One is the coded value. The other is the full value. It's called a lookup table simply because of its use, which is to translate the coded value into the full value. In the query you just join the coded value field in the two tables.
Sep 5 '07 #6
Rabbit
12,516 Expert Mod 8TB
Resuscribing .
Sep 5 '07 #7

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

Similar topics

3
by: Lord Merlin | last post by:
When using "if then" statements in global, I get the following error: a.. Error Type: (0x8002802B) Element not found. //global.asa, line 12 Can I use if then statements in global?
11
by: Khaled Afiouni | last post by:
Hello, How can I stop/prevent SQL server from running compound SQL statements. I do not want the server to run multiple update/delete/insert/select statements as a batch. Is there an option? ...
1
by: Tom D | last post by:
I'm rewriting a database interface that our company currently has. Currently it's using the Pear::DB interface, but we found that that was introducing a bit too much overhead. I'm rewriting the...
6
by: Kenneth | last post by:
Hi Is it possible to see all kinds of executed SQL-statements in a logfile? If yes, how do I do that and how much information does it log? Thanks, Kenneth
7
by: Glenn Davy | last post by:
Hidely hodley everyone I'd like to run a series of of sql ddl statements against an msde2000 server. Normally I just deploy cmd file that impliments as osql statement, but I'd like to store the...
92
by: Raghavendra R A V, CSS India | last post by:
hie.. Do any one knows how to write a C program without using the conditional statements if, for, while, do, switch, goto and even condotional statements ? It would be a great help for me if...
39
by: slogging_away | last post by:
Hi - I'm running Python 2.4.2 (#67, Sep 28 2005, 12:41:11) on win32, and have a script that makes numerous checks on text files, (configuration files), so discrepancies can be reported. The script...
9
by: colin.mcnulty | last post by:
Hi, I'm a SQL Server DBA, but I guess that won't buy me any friends round here huh? ;-) I've been asked to look at the SQL that's being executed on a DB2 database from a web app, specifically...
3
by: Simone | last post by:
Hello I am pretty new to asp.net :) I have a program that loops through a few sql statements and performs inserts. The problem is the sql statements are different for every upcoming new...
7
by: =?Utf-8?B?QVRT?= | last post by:
HOWTO Run multiple SQL statements from ASP/ADO to an Oracle 10g. Please help, I'm trying to write an ASP page to use ADO to run a long query against an Oracle 10g database, to create tables,...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.