Mau Mau
Mau Mau

Reputation: 1

Access Criteria IIF Statement Issue

I'm trying to qualify a field based on a date. If the frequency of the data is supposed to be weekly, I want to select one specific weekend date. If the frequency is monthly, I want the frequency to include the specific weekend date and all weeks thereafter. However, my statement below returns a blank table when False ("Monthly"). I'm guessing there's some specific formatting I have to do to the >= but I'm drawing a blank. Any suggestions?

=IIf([Frequency]="Weekly",[WK_end_Date],>=[WK_end_Date])

FYI... the false statement works correctly when I input only that specific criteria without the IIF statement.

Thanks, Mark

Upvotes: 0

Views: 36

Answers (1)

Gustav
Gustav

Reputation: 55816

You can't use IIf this way. Correct your Where clause like this:

Where 
    ([Frequency] = "Weekly" And [YourDateField] = [WK_end_Date]) 
    Or 
    ([Frequency] <> "Weekly" And [YourDateField] >= [WK_end_Date])

Upvotes: 1

Related Questions