From: John Spencer on
IT would help if you posted the entire SQL statement (View: SQL).

As a GUESSS, you are in query design view and have something like the
following (all on one line)

Field: [Days Available]: IIF([LastDayAvailable]>Date(), [LastDayAvailable],
Date())-[Days Available]

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

John Spencer wrote:
> IIF([LastDayAvailable]>Date(),[LastDayAvailable],Date()) - [Days Available]
>
> John Spencer
> Access MVP 2002-2005, 2007-2010
> The Hilltop Institute
> University of Maryland Baltimore County
>
> Bibi wrote:
>> I do not know how to tweak the code below to calculate the number of
>> days available from the current day in those cases where the first
>> day available is before the current date.
>>
>> Could someone help with an " If ...........then.........else...........
>>
>> Here's the code:
>>
>> [LastDayAvailable]-[Depart] AS [Days Available]
>> I need to add something here to show that if the [LastDayAvailable] is
>> before the current Date() then [Days Available] should be calculated
>> from Date()- [Depart] rather than from the [LastDayAvailalble].
>>
>> All help appreciated.
>>
>> TIA
>> Bibi