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

Null as falsepart of IIf Statement

13
Hi,

I'm looking for some guidance on how to approach a problem. We are continuously pulling recurring work order tasks from one database into a new one that I've built in Access (one with more ability to track man hours and other info). Most of the fields map nicely.

The trades field in the original is rather polluted. It was called AssignedTo and instead of simply having Electrician and Mechanical as choices, multi-users over the years have added about 50 names and initials of personnel.

So I'd like to have a query that looks at that field when the record is imported and says:

Expand|Select|Wrap|Line Numbers
  1. IIf([AssignedTo]="Elect",1,IIf([AssignedTo]="Mech",2,Null))
Can I do that? Use Null as my falsepart?

Because I already have a query that looks for Work Orders with Null values in the trades field and identifies them as orphans. We have a process to bring them up and assign them so they don't fall thru the cracks.

Can anyone tell me if using Null will work or should I use Nz, which would put a zero in that field? And in which case, will my orphan query that has an IIf IsNull statement pick up the zeros and tag them as orphans?

Thanks for any education you can offer. Still learning ;)
Feb 21 '13 #1

✓ answered by Rabbit

Yes, you can use a Null if you want.

1 1594
Rabbit
12,516 Expert Mod 8TB
Yes, you can use a Null if you want.
Feb 21 '13 #2

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

Similar topics

3
by: Eric Linders | last post by:
Hello, We have a form that is collecting user input. There are three fields for each phone number (area code, prefix and suffix). I'm trying to use a simple if statement to confirm if the first...
3
by: iStrain | last post by:
Hiya. I'm _sure_ this is an FAQ, but Googling hasn't produced the answer in a way I can make sense out of. I know I should get this, but so far no way... I'm creating tables and doing queries in...
6
by: ryan.mclean | last post by:
Hi all, first, let me preface this by saying that I am very new to sql server, coming from oracle. Here is my problem: I would like to have a case statement (similar to decode in oracle) that...
7
by: mark | last post by:
Access 2000: I creating a report that has a record source built by the user who selects the WHERE values. An example is: SELECT * FROM CHARGELOG WHERE STDATE Between #10/27/2003# And...
3
by: Andy_Khosravi | last post by:
I have been trying to build a user friendly search engine for a small database I have created. I'm having some particular problems with one of my date fields. Here's the setup: I'm using...
9
by: Michael | last post by:
Hi all, I would like to get people's opinion about executing SQL statements in C# (or any other .NET language really). I used to create my SQL statement by building a string and replacing single...
6
by: Rajat Katyal | last post by:
Hi: In postgres documentation its written that if we execute query as PERFORM query inside our stored procedure; then the special variable FOUND is set totrue if the query produced at least one...
22
by: pbd22 | last post by:
hi. I am having probelms with an update statement. every time i run it, "every" row updates, not just the one(s) intended. so, here is what i have. i have tried this with both AND and OR and...
1
by: codedhacker | last post by:
I have a piece of code that uses the db-library with sql server 2000/2005 and runs the following delete statement: DELETE FROM TABLE1 WHERE COL1 IN( 'Some Val1' ) AND COL2 IN( 'Some Val2' )...
5
ddtpmyra
by: ddtpmyra | last post by:
What is the syntax of inserting a value on a table with CASE statement or IF stmt. I have PHP form that holds the value, now I wanted to skip the insert value if the text box value is null but I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.