Find new date base on the Last Verified date

  • Thread starter Thread starter Jacqueline
  • Start date Start date
J

Jacqueline

I have a simple problem or so I thought. I have three different levels, based
on the level I need to add either 365, 180, or 90 days to the LastDate field.
Here is the code I am useing, been through it a million times and can't
figure what is wrong. If anyone is out there... Help!

=IIf([Level]="3",([LastDate]*365,IIf([Level]="2",([LastDate]*180,IIf([Level]="1",([LastDate]*90,"Error"))))))

This code is entered in a text box, when I run the form the box comes up
blank, it does not even have an error message.
Any help will be a life saver!!
Jacqueline
 
Jacqueline,

I only see a couple of things but it should work....

1. Is Level really a text field. If yes leave the quotes, if no remove the
quotes.
2. I removed the extra paranthesis, see below...
3. Level is a reserved word and you really should try to avoid using those
as field names, see...

http://allenbrowne.com/AppIssueBadWord.html#L

=IIf([Level]="3",[LastDate]*365,IIf([Level]="2",[LastDate]*180,IIf([Level]="1",[LastDate]*90,"Error")))


--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
Thanks for the help Gina, yes Level and LastDate are both fields within the
table that is data source for the form. I did discover that I was trying to
multipy a date instead of adding days, and it appears to be working now...
Here is the code I finally debugged. :)

=IIf(([Level])="1",([LastDate])+365,IIf([Level]="2",([LastDate])+183,IIf([Level]="3",([LastDate])+90,0)))

Thanks so much for getting back to me, it is good to know there are other
nuts like me that is working on DB at all hours of the day!

Have a great day or night, depending on where you are. :)
Jacqueline

Gina Whipp said:
Jacqueline,

I only see a couple of things but it should work....

1. Is Level really a text field. If yes leave the quotes, if no remove the
quotes.
2. I removed the extra paranthesis, see below...
3. Level is a reserved word and you really should try to avoid using those
as field names, see...

http://allenbrowne.com/AppIssueBadWord.html#L

=IIf([Level]="3",[LastDate]*365,IIf([Level]="2",[LastDate]*180,IIf([Level]="1",[LastDate]*90,"Error")))


--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Jacqueline said:
I have a simple problem or so I thought. I have three different levels,
based
on the level I need to add either 365, 180, or 90 days to the LastDate
field.
Here is the code I am useing, been through it a million times and can't
figure what is wrong. If anyone is out there... Help!

=IIf([Level]="3",([LastDate]*365,IIf([Level]="2",([LastDate]*180,IIf([Level]="1",([LastDate]*90,"Error"))))))

This code is entered in a text box, when I run the form the box comes up
blank, it does not even have an error message.
Any help will be a life saver!!
Jacqueline
 
Jacqueline,

You're welcome... as a side not, you don't need paranthesis around
LastDate.

Yes, it's night here and yep there are a few of us nuts that work day and/or
night!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Jacqueline said:
Thanks for the help Gina, yes Level and LastDate are both fields within
the
table that is data source for the form. I did discover that I was trying
to
multipy a date instead of adding days, and it appears to be working now...
Here is the code I finally debugged. :)

=IIf(([Level])="1",([LastDate])+365,IIf([Level]="2",([LastDate])+183,IIf([Level]="3",([LastDate])+90,0)))

Thanks so much for getting back to me, it is good to know there are other
nuts like me that is working on DB at all hours of the day!

Have a great day or night, depending on where you are. :)
Jacqueline

Gina Whipp said:
Jacqueline,

I only see a couple of things but it should work....

1. Is Level really a text field. If yes leave the quotes, if no remove
the
quotes.
2. I removed the extra paranthesis, see below...
3. Level is a reserved word and you really should try to avoid using
those
as field names, see...

http://allenbrowne.com/AppIssueBadWord.html#L

=IIf([Level]="3",[LastDate]*365,IIf([Level]="2",[LastDate]*180,IIf([Level]="1",[LastDate]*90,"Error")))


--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Jacqueline said:
I have a simple problem or so I thought. I have three different levels,
based
on the level I need to add either 365, 180, or 90 days to the LastDate
field.
Here is the code I am useing, been through it a million times and can't
figure what is wrong. If anyone is out there... Help!

=IIf([Level]="3",([LastDate]*365,IIf([Level]="2",([LastDate]*180,IIf([Level]="1",([LastDate]*90,"Error"))))))

This code is entered in a text box, when I run the form the box comes
up
blank, it does not even have an error message.
Any help will be a life saver!!
Jacqueline
 
Back
Top