Connecting Tech Pros Worldwide Help | Site Map

Calculated Date = 4 weeks before Date ... How ?

David Allison
Guest
 
Posts: n/a
#1: Nov 12 '05
Hi, I need a Calculated Date = 4 weeks before Date which is in table ...
How ?
--
Dave Allison ~ Scotland


Allen Browne
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Calculated Date = 4 weeks before Date ... How ?


Create a query into this table.
If the field is called MyDate, type this into a fresh column of the query
design grid:
CalcDate: DateDiff("d", -28, [MyDate])

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"David Allison" <david.allison@zzzz@zzzzzblueyonder.co.uk> wrote in message
news:MS4vb.12897$zQ.6577@news-binary.blueyonder.co.uk...[color=blue]
> Hi, I need a Calculated Date = 4 weeks before Date which is in table ...[/color]


David Allison
Guest
 
Posts: n/a
#3: Nov 12 '05

re: Calculated Date = 4 weeks before Date ... How ?


Cheers - I will try this
--
Dave Allison ~ Scotland
"Allen Browne" <AllenBrowne@SeeSig.Invalid> wrote in message
news:3fbcdf95$0$1741$5a62ac22@freenews.iinet.net.a u...[color=blue]
> Create a query into this table.
> If the field is called MyDate, type this into a fresh column of the query
> design grid:
> CalcDate: DateDiff("d", -28, [MyDate])
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "David Allison" <david.allison@zzzz@zzzzzblueyonder.co.uk> wrote in[/color]
message[color=blue]
> news:MS4vb.12897$zQ.6577@news-binary.blueyonder.co.uk...[color=green]
> > Hi, I need a Calculated Date = 4 weeks before Date which is in table[/color][/color]
....[color=blue]
>
>[/color]


David Allison
Guest
 
Posts: n/a
#4: Nov 12 '05

re: Calculated Date = 4 weeks before Date ... How ?


Form for booking holidays -I have -
DateofBooking ... DateofTravel .... fields in table

On the form I have .........
payment of deposit is due.... =[DateofBooking]+28 ......... got that working
OK :>)

Still cant get payment of balance due (12 weeks before
DateofTravel)...........thought it would be
=[DateofTravel]-84 ????????

[color=blue]
> Create a query into this table.
> If the field is called MyDate, type this into a fresh column of the query
> design grid:
> CalcDate: DateDiff("d", -28, [MyDate])
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "David Allison" <david.allison@zzzz@zzzzzblueyonder.co.uk> wrote in[/color]
message[color=blue]
> news:MS4vb.12897$zQ.6577@news-binary.blueyonder.co.uk...[color=green]
> > Hi, I need a Calculated Date = 4 weeks before Date which is in table[/color][/color]
....[color=blue]
>
>[/color]


Bruce M. Thompson
Guest
 
Posts: n/a
#5: Nov 12 '05

re: Calculated Date = 4 weeks before Date ... How ?


> Create a query into this table.[color=blue]
> If the field is called MyDate, type this into a fresh column of the query
> design grid:
> CalcDate: DateDiff("d", -28, [MyDate])[/color]

I think Allen meant:

CalcDate: DateAdd("d", -28, [MyDate])

:-)
--
Bruce M. Thompson, Microsoft Access MVP
bthmpson@mvps.org (See the Access FAQ at http://www.mvps.org/access)[color=blue][color=green]
>> NO Email Please. Keep all communications[/color][/color]
within the newsgroups so that all might benefit.<<


David Allison
Guest
 
Posts: n/a
#6: Nov 12 '05

re: Calculated Date = 4 weeks before Date ... How ?


Gives Invalid . or !

--
Dave Allison ~ Scotland
"Bruce M. Thompson" <bthmpson@big_NOSPAM_foot.com> wrote in message
news:vrppmiec0bm810@corp.supernews.com...[color=blue][color=green]
> > Create a query into this table.
> > If the field is called MyDate, type this into a fresh column of the[/color][/color]
query[color=blue][color=green]
> > design grid:
> > CalcDate: DateDiff("d", -28, [MyDate])[/color]
>
> I think Allen meant:
>
> CalcDate: DateAdd("d", -28, [MyDate])
>
> :-)
> --
> Bruce M. Thompson, Microsoft Access MVP
> bthmpson@mvps.org (See the Access FAQ at http://www.mvps.org/access)[color=green][color=darkred]
> >> NO Email Please. Keep all communications[/color][/color]
> within the newsgroups so that all might benefit.<<
>
>[/color]


Allen Browne
Guest
 
Posts: n/a
#7: Nov 12 '05

re: Calculated Date = 4 weeks before Date ... How ?


Provided Access recognises DateOfTravel as a Date/Time field, then:
=[DateOfTravel] - 84
should work. Set the Format property of this text box to:
Short Date

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"David Allison" <david.allison@zzzz@zzzzzblueyonder.co.uk> wrote in message
news:7E5vb.13742$zQ.9354@news-binary.blueyonder.co.uk...[color=blue]
> Form for booking holidays -I have -
> DateofBooking ... DateofTravel .... fields in table
>
> On the form I have .........
> payment of deposit is due.... =[DateofBooking]+28 ......... got that[/color]
working[color=blue]
> OK :>)
>
> Still cant get payment of balance due (12 weeks before
> DateofTravel)...........thought it would be
> =[DateofTravel]-84 ????????
>
>[color=green]
> > Create a query into this table.
> > If the field is called MyDate, type this into a fresh column of the[/color][/color]
query[color=blue][color=green]
> > design grid:
> > CalcDate: DateDiff("d", -28, [MyDate])
> >
> > --
> > Allen Browne - Microsoft MVP. Perth, Western Australia.
> > Tips for Access users - http://allenbrowne.com/tips.html
> > Reply to group, rather than allenbrowne at mvps dot org.
> >
> > "David Allison" <david.allison@zzzz@zzzzzblueyonder.co.uk> wrote in[/color]
> message[color=green]
> > news:MS4vb.12897$zQ.6577@news-binary.blueyonder.co.uk...[color=darkred]
> > > Hi, I need a Calculated Date = 4 weeks before Date which is in table[/color][/color][/color]


Bruce M. Thompson
Guest
 
Posts: n/a
#8: Nov 12 '05

re: Calculated Date = 4 weeks before Date ... How ?


> Gives Invalid . or !

That would have to be derived from an argument passed to the function. If you
are using this in a form, post your code. If you are using this in a query, post
the expression you are using.

--
Bruce M. Thompson, Microsoft Access MVP
bthmpson@mvps.org (See the Access FAQ at http://www.mvps.org/access)[color=blue][color=green]
>> NO Email Please. Keep all communications[/color][/color]
within the newsgroups so that all might benefit.<<


David Allison
Guest
 
Posts: n/a
#9: Nov 12 '05

re: Calculated Date = 4 weeks before Date ... How ?


I have a field DateofTravel on the form and in table where date is stored.

I need balence due date which is 12 weeks before DateofTravel.

((I managed easily to get deposit due date which is 4 weeks after booking)
=[DateofBooking]+28

--
Dave Allison ~ Scotland
"Bruce M. Thompson" <bthmpson@big_NOSPAM_foot.com> wrote in message
news:vrpqfh4kq5pif7@corp.supernews.com...[color=blue][color=green]
> > Gives Invalid . or ![/color]
>
> That would have to be derived from an argument passed to the function. If[/color]
you[color=blue]
> are using this in a form, post your code. If you are using this in a[/color]
query, post[color=blue]
> the expression you are using.
>
> --
> Bruce M. Thompson, Microsoft Access MVP
> bthmpson@mvps.org (See the Access FAQ at http://www.mvps.org/access)[color=green][color=darkred]
> >> NO Email Please. Keep all communications[/color][/color]
> within the newsgroups so that all might benefit.<<
>
>[/color]


Closed Thread