BamaColtsFan
Registered User.
- Local time
- Today, 03:33
- Joined
- Nov 8, 2006
- Messages
- 91
Ok, so I'm trying to use nested IIf statements to determine the value of one column in a query. For some reason, I can't get the query to accept the third statement. Naturally, I'm using Access 2007 which, rather than actually tell me what the error is, it simply reverts back to the previously saved statement when it doesn't like what I type so I have no clue what the problem actually is. Whoever decided that little trick should be included in Access needs to be beaten severly...
Anyway, I can't figure out what is wrong with the following:
Any advice would be appreciated!
THNX!
Oh by the way - I forgot to mention that it works perfectly with just two nested IIf statements...
Anyway, I can't figure out what is wrong with the following:
Code:
Reason: IIf([Name] In (SELECT [Trouble Tickets].Name
FROM [Trouble Tickets]
WHERE [Trouble Tickets]![Timecard Stop Date] = [CombinedTimecards]![Timecard Stop Date]
And [Trouble Tickets]![Name] = [CombinedTimecards]![Name]
And [Trouble Tickets]![Date Closed] is NULL ),'TICKET',
(IIf([Name] In (SELECT [Deployed Soldiers].[Deployed_Name]
FROM [Deployed Soldiers]
WHERE [Deployed Soldiers].[Deployed] = True
And [Deployed Soldiers].[Deployed_Name] = [CombinedTimecards]![Name]
And [CombinedTimecards].[Timecard Stop Date] BETWEEN [Deployed Soldiers].[Depart_Date]
And [Deployed Soldiers].[Return_Date]),'DEPLOYED/LWOP',
(IIf([Name] In (SELECT [qryDelinquentBatch].Name
FROM [qryDelinquentBatch]
WHERE [qryDelinquentBatch]![Timecard Stop Date] = [CombinedTimecards]![Timecard Stop Date]
And [qryDelinquentBatch]![Name] = [CombinedTimecards]![Name] ), 'Batch',
' '))))
Any advice would be appreciated!
THNX!
Oh by the way - I forgot to mention that it works perfectly with just two nested IIf statements...
Last edited: