From: John Spencer on 22 Apr 2010 09:31 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
First
|
Prev
|
Pages: 1 2 Prev: Query between 2 tables with one-to-many relationship Next: Help with 3 scenerio query |