A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Expiration Formula



 
 
Thread Tools Display Modes
  #1  
Old September 30th, 2007, 03:49 PM posted to microsoft.public.access.forms
[email protected][_2_]
external usenet poster
 
Posts: 42
Default Expiration Formula

One more question. This formula works great, with the exception of, if
someone signed the paperwork prior to 9/2, it tells me their paperwork
expired 9/1/07. I need it to tell me that if Kool Kidz signed before
9/2 that it will expire one year later; otherwise if signed on 9/2 and
later it will expire on 9/1 of the next year.

It works great if the [Date] is 9/2/07 and greater.
Now my situation is if the [Date], for example is 8/31/07, it shows
an expiration date of 9/1/07. If the [Date] is less than 9/2/07, it
needs to be 1 year from [Date]. Is this possible. Thanks again.

This is what I have so far.

=Switch([ClassroomID]="Bumble Bears",DateAdd("yyyy",1,[Date]),
[ClassroomID]="Doodlebugs",DateAdd("yyyy",1,[Date]),
[ClassroomID]="Dandeelions",DateAdd("yyyy",1,[Date]),
[ClassroomID]="Kinder-Ready",DateAdd("yyyy",1,[Date]),
[ClassroomID]="Kool Kidz",DateSerial(Year([Date])-
(CLng(Format([Date],"mmdd"))901),9,1))

  #2  
Old September 30th, 2007, 07:36 PM posted to microsoft.public.access.forms
[email protected][_2_]
external usenet poster
 
Posts: 42
Default Expiration Formula

On Sep 30, 10:49 am, "
wrote:
One more question. This formula works great, with the exception of, if
someone signed the paperwork prior to 9/2, it tells me their paperwork
expired 9/1/07. I need it to tell me that if Kool Kidz signed before
9/2 that it will expire one year later; otherwise if signed on 9/2 and
later it will expire on 9/1 of the next year.

It works great if the [Date] is 9/2/07 and greater.
Now my situation is if the [Date], for example is 8/31/07, it shows
an expiration date of 9/1/07. If the [Date] is less than 9/2/07, it
needs to be 1 year from [Date]. Is this possible. Thanks again.

This is what I have so far.

=Switch([ClassroomID]="Bumble Bears",DateAdd("yyyy",1,[Date]),
[ClassroomID]="Doodlebugs",DateAdd("yyyy",1,[Date]),
[ClassroomID]="Dandeelions",DateAdd("yyyy",1,[Date]),
[ClassroomID]="Kinder-Ready",DateAdd("yyyy",1,[Date]),
[ClassroomID]="Kool Kidz",DateSerial(Year([Date])-
(CLng(Format([Date],"mmdd"))901),9,1))


YEAH. I got it. Thank you for all your suggestions. This is the final
formula.

=IIf([ClassroomID]="Kool Kidz" And
(Format([Date],"mmdd")901),DateSerial(Year([Date])-
(CLng(Format([Date],"mmdd"))901),9,1),DateAdd("yyyy",1,[Date]))

  #3  
Old September 30th, 2007, 07:58 PM posted to microsoft.public.access.forms
Pieter Wijnen
external usenet poster
 
Posts: 1,354
Default Expiration Formula

Ammend the [ClassroomID]="Kool Kidz" to
[ClassroomID]="Kool Kidz",IIF(CLng(Format([Date],"mmdd"))902),
DateAdd("yyyy",1,[Date]),DateSerial(Year([Date]), 9,1))

HTH

Pieter

BTW The reserved words thingy isn't all that bad, you just have to remember
to always use hard brackets [] g

wrote in message
oups.com...
On Sep 30, 10:49 am, "
wrote:
One more question. This formula works great, with the exception of, if
someone signed the paperwork prior to 9/2, it tells me their paperwork
expired 9/1/07. I need it to tell me that if Kool Kidz signed before
9/2 that it will expire one year later; otherwise if signed on 9/2 and
later it will expire on 9/1 of the next year.

It works great if the [Date] is 9/2/07 and greater.
Now my situation is if the [Date], for example is 8/31/07, it shows
an expiration date of 9/1/07. If the [Date] is less than 9/2/07, it
needs to be 1 year from [Date]. Is this possible. Thanks again.

This is what I have so far.

=Switch([ClassroomID]="Bumble Bears",DateAdd("yyyy",1,[Date]),
[ClassroomID]="Doodlebugs",DateAdd("yyyy",1,[Date]),
[ClassroomID]="Dandeelions",DateAdd("yyyy",1,[Date]),
[ClassroomID]="Kinder-Ready",DateAdd("yyyy",1,[Date]),
[ClassroomID]="Kool Kidz",DateSerial(Year([Date])-
(CLng(Format([Date],"mmdd"))901),9,1))


YEAH. I got it. Thank you for all your suggestions. This is the final
formula.

=IIf([ClassroomID]="Kool Kidz" And
(Format([Date],"mmdd")901),DateSerial(Year([Date])-
(CLng(Format([Date],"mmdd"))901),9,1),DateAdd("yyyy",1,[Date]))



  #4  
Old October 1st, 2007, 10:43 AM posted to microsoft.public.access.forms
Pieter Wijnen
external usenet poster
 
Posts: 1,354
Default Expiration Formula

That should've been

[ClassroomID]="Kool Kidz",IIF(CLng(Format([Date],"mmdd"))902),
DateAdd("yyyy",1,[Date]),DateSerial(Year([Date])+1, 9,1))

And The whole thing can be written as

IIf ([ClassroomID]="Kool Kidz" And CLng(Format([Date],"mmdd"))901,
DateSerial(Year([Date])+1, 9,1), DateAdd("yyyy",1,[Date]))

HtH

Pieter



"Pieter Wijnen"
it.isi.llegal.to.send.unsollicited.mail.wijnen.no
wrote in message ...
Ammend the [ClassroomID]="Kool Kidz" to
[ClassroomID]="Kool Kidz",IIF(CLng(Format([Date],"mmdd"))902),
DateAdd("yyyy",1,[Date]),DateSerial(Year([Date]), 9,1))

HTH

Pieter

BTW The reserved words thingy isn't all that bad, you just have to
remember to always use hard brackets [] g

wrote in message
oups.com...
On Sep 30, 10:49 am, "
wrote:
One more question. This formula works great, with the exception of, if
someone signed the paperwork prior to 9/2, it tells me their paperwork
expired 9/1/07. I need it to tell me that if Kool Kidz signed before
9/2 that it will expire one year later; otherwise if signed on 9/2 and
later it will expire on 9/1 of the next year.

It works great if the [Date] is 9/2/07 and greater.
Now my situation is if the [Date], for example is 8/31/07, it shows
an expiration date of 9/1/07. If the [Date] is less than 9/2/07, it
needs to be 1 year from [Date]. Is this possible. Thanks again.

This is what I have so far.

=Switch([ClassroomID]="Bumble Bears",DateAdd("yyyy",1,[Date]),
[ClassroomID]="Doodlebugs",DateAdd("yyyy",1,[Date]),
[ClassroomID]="Dandeelions",DateAdd("yyyy",1,[Date]),
[ClassroomID]="Kinder-Ready",DateAdd("yyyy",1,[Date]),
[ClassroomID]="Kool Kidz",DateSerial(Year([Date])-
(CLng(Format([Date],"mmdd"))901),9,1))


YEAH. I got it. Thank you for all your suggestions. This is the final
formula.

=IIf([ClassroomID]="Kool Kidz" And
(Format([Date],"mmdd")901),DateSerial(Year([Date])-
(CLng(Format([Date],"mmdd"))901),9,1),DateAdd("yyyy",1,[Date]))





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:47 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.