Re: IIF Syntax

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Paul

Perhaps it is insufficient caffeine this morning, but I don't understand
what problem you are having.

(if you wish to exclude "nulls", use a WHERE clause to do that)

Regards

Jeff Boyce
Microsoft Office/Access MVP


"Paul LeBlanc" <PaulLeBlanc@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4DC588BB-0723-4A4A-B151-7178FBD230E5@xxxxxxxxxxxxxxxx
I'm having a problem with the following statement
SOURCE:
IIf(Mid$([TblProp]![SOURCE],1,2)=[TblSTAGE]![STAGE],[TblSTAGE]![STAGENAME])
When I added it to the SQL statement
SELECT TblPROP.CODE, VARIETY.NAME, TblPROP.PLOT, TblPROP.DATEIN,
TblPROP.DATEOUT, TblPROP.QTY, TblPROP.LOC, TblPROP.SEQ,
IIf([Qty]<315,1,Int([QTY]/315)) AS [ROWS],
IIf(Mid$([TblProp]![SOURCE],1,2)=[TblSTAGE]![STAGE],[TblSTAGE]![STAGENAME])
AS SOURCE, "*" & [CODE] & [PLOT] & [LOC] & [SEQ] & "*" AS BC
FROM TblSTAGE, TblPROP INNER JOIN VARIETY ON TblPROP.CODE =
VARIETY.ItemCode
WHERE (((TblPROP.DATEIN)=[STICK WEEK ?]))
ORDER BY TblPROP.LOC, TblPROP.SEQ;
I get thousands of results, most with the source field null but always
with
one that is right


.



Relevant Pages

  • Re: Select Query
    ... Maybe not so much the AND's/OR's, but more the parentheses. ... See if this will work for your WHERE clause: ... So I want to exclude any value that matches any of the values listed ... When ever you are excluding multiple values in a query, ...
    (microsoft.public.access.queries)
  • Re: Select Query
    ... Maybe not so much the AND's/OR's, but more the parentheses. ... See if this will work for your WHERE clause: ... So I want to exclude any value that matches any of the values listed ... When ever you are excluding multiple values in a query, ...
    (microsoft.public.access.queries)
  • Re: NOT IN with a subquery
    ... If source is NULL then the IN clause will be NULL ... Pro SQL Server 2000 Database Design - ... >> NULLs. ... >> from clients ...
    (microsoft.public.sqlserver.programming)
  • Re: Auto filling
    ... You could write a simple UPDATE command in Query Analyzer, ... SET newColumn = 'EN' ... If you exclude the WHERE clause, ...
    (microsoft.public.sqlserver.programming)
  • Re: Auto filling
    ... You could write a simple UPDATE command in Query Analyzer, ... SET newColumn = 'EN' ... If you exclude the WHERE clause, ...
    (microsoft.public.sqlserver.server)