D
Dick Minter
The query shown below returns no records. The criteria entered direcly
without the iif performs as intended, e.g. '[forms].[fmChkList].[cbSeu] OR 1'
works if entered without the IIF expression, but as the value returned by the
iif finds no records. Note: The appostrophes in my example are for
emphasis; the values are integers.
SELECT Sources.Name, Sources.SourceID, SourceStatus.Description AS Status,
Sources.Payment_required, Market.SEUno
FROM Market INNER JOIN (SourceStatus INNER JOIN Sources ON
SourceStatus.Status = Sources.Status) ON Market.SEUno = Sources.SEU
WHERE
(((Market.SEUno)=IIf([forms].[fmChkList].[cbseu]=1,[market].[seuno],([Market].[SEUno])=[forms].[fmChkList].[cbseu] Or ([Market].[SEUno])=1)))
ORDER BY Sources.Name;
I've considered defiing and running a sql statement in the form code where
the correct criteria can be set as a string, but why doesn't the above
statement work?
DM
without the iif performs as intended, e.g. '[forms].[fmChkList].[cbSeu] OR 1'
works if entered without the IIF expression, but as the value returned by the
iif finds no records. Note: The appostrophes in my example are for
emphasis; the values are integers.
SELECT Sources.Name, Sources.SourceID, SourceStatus.Description AS Status,
Sources.Payment_required, Market.SEUno
FROM Market INNER JOIN (SourceStatus INNER JOIN Sources ON
SourceStatus.Status = Sources.Status) ON Market.SEUno = Sources.SEU
WHERE
(((Market.SEUno)=IIf([forms].[fmChkList].[cbseu]=1,[market].[seuno],([Market].[SEUno])=[forms].[fmChkList].[cbseu] Or ([Market].[SEUno])=1)))
ORDER BY Sources.Name;
I've considered defiing and running a sql statement in the form code where
the correct criteria can be set as a string, but why doesn't the above
statement work?
DM