|
|
days between tweak
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
|
|
0
|
|
|
|
Reply
|
Utf
|
4/21/2010 7:31:01 PM |
|
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
|
|
0
|
|
|
|
Reply
|
John
|
4/21/2010 7:38:16 PM
|
|
Try a datediff command:
Datediff("d", [first date],[second date])
That will give you days, even if it is neagative.
--
Milton Purdy
ACCESS
State of Arkansas
"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
|
|
0
|
|
|
|
Reply
|
Utf
|
4/21/2010 7:49:02 PM
|
|
I don't think that will do it - It is still calculating the difference
between both dates , not from the current date in those instances when the
start date is BEFORE the current date......
I'm sorry I'm not expressing this very clearly..........
For example:
If a home becomes vacant on April 5th and is not booked until April 20th -
at the start, it is available for 15 days..... but on April 12th it is only
available for 8 days .
So for those cases where the start date is BEFORE the current date I need a
different calculation that if the start date is on or after the current date
.........
TIA
Bibi
"golfinray" wrote:
> Try a datediff command:
> Datediff("d", [first date],[second date])
> That will give you days, even if it is neagative.
> --
> Milton Purdy
> ACCESS
> State of Arkansas
>
>
> "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
|
|
0
|
|
|
|
Reply
|
Utf
|
4/21/2010 8:53:01 PM
|
|
Thank you - i"m getting closer but I'm getting a circular reference if I
replace my initial code
[LastDayAvailable]-[Depart] AS [Days Available]
with the new code...........and the alternates I've tried aren't working -
I'm sorry I'm being so dense on this.....
--
TIA
Bibi
"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
> .
>
|
|
0
|
|
|
|
Reply
|
Utf
|
4/21/2010 9:13:02 PM
|
|
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
|
|
0
|
|
|
|
Reply
|
John
|
4/22/2010 1:31:47 PM
|
|
|
5 Replies
132 Views
(page loaded in 0.96 seconds)
Similiar Articles: Difference between two date/time values - microsoft.public.excel ...Tweak... >Assuming the date/time in A2 will *always* be >= the date/time in ... the difference in days should be more than 14 as there is are >> 31 days of May between the ... Adding Business Days only - microsoft.public.access.forms ...Tweak to fit your actual business rule which I don't quite understand given your ... Excel :: Days Between 2 Dates Excluding Weekends Add Worksheet With Dates As Names & No ... SBS 2008 Slow Network Performance with Windows XP Clients ...However, all these woes disappear if the client is Windows 7 - the speed difference is night and day! Is there something that can be done to tweak Windows XP to ... tasks due in the next week/tasks overdue - microsoft.public ...... in just a few months, let alone a in a matter of days. ... schedules - depending on how long has elapsed between the ... I tried to tweak the overdue items formula by using this ... Need formula to calculate bi-monthly pay dates - microsoft.public ...... that returns all pay dates for the 15th and last day ... Minor tweak that saves a few keystrokes and eliminates ... Formula for calculating time period between 2 dates ... Simple sum won't work - microsoft.public.access.reports ...Querying between two dates doesn't work if Start and End ... file. the table has a column for the job #, 5 days to ... I'm 100% sure that Excel won't let you tweak wrongly ... Formatting Text in Network Diagram View - microsoft.public.project ...Change date to days - microsoft.public.project By ... following: To display link lines as straight lines between ... Format the project in Microsoft Project - Tips & Tweaks ... intermittent WLM crash - microsoft.public.windows.live.mail ...... from http://download.live.com, you can choose between ... But this crash happens maybe once or twice a day. ... On Registry Tweaks for WLMail 14x (Quick views & Line ... Old VB Project doesn't work with New Office or Windows 7 ...> : > : It must have to do with the link between Office and the ... to fix this issue, as I suspect it requires a tweak or ... break out over the language debate in the next day ... Slow Startup & Shutdown... - microsoft.public.windows.64bit ...If the problem is gone the cause is a conflict between ... Sinclair wrote: >> Hmm...yes, perhaps the same day of ... slow - Windows XP - Windows XP Fixes, Tips and Tweaks How ... 85 days to Olympics, London tests and tweaks - TODAY in LondonWith 85 days to go until the London Olympics begin ... only a week ago hosted a tune-up game between Britain ... way that their venue might need an additional tweak ... Tweaking - Wikipedia, the free encyclopediaTweaking refers to fine-tuning or adjusting a complex system, usually an electronic device. Tweaks are any small modifications intended to improve a system. In ... The trust relationship between this workstation and the primary ...First, let me say… I get about 100 unique hits on this post every day. We are not alone! Below, I describe a fix to the relationship. But I want to know ... tweak - definition of tweak by the Free Online Dictionary ...forum Join the Word of the Day Mailing List For ... tweak (tw k) tr.v. tweaked, tweak·ing, tweaks. 1. To pinch ... squeeze tightly between the fingers; "He pinched her ... Crystal Meth: Tweak's Mystique - Do It Now!Crystal Meth | Tweak's Mystique: Author: Jim ... all kinds of people are taking them these days. ... giving the old body/mind a chance to chill between ... 7/25/2012 9:28:27 AM
|
|
|
|
|
|
|
|
|