Date Difference

B

blake7

Hi All,
I have a text field formatted to date, the date is chosen using the date
picker, I would like to put another text box on the form to display the words
"overdue" if the the field displaying the date is greater than 14 days else
display "Waiting". Thanks in advance.
Regards
Tony
 
K

KARL DEWEY

Try this --
IIF(DateDiff("d", Date(),CVDate([YourTextDate])) >14, "Overdue",
"Waiting")
 
B

blake7

Hi Karl, Thanks for your reply, I have put the code below in an unbound text
box but when I view the form it just comes back with #NAME?, what have i done
wrong?
Thanks. Tony


IIF(DateDiff("d", Date(),CVDate([Sent Date])) >14, "Overdue", "Waiting")

KARL DEWEY said:
Try this --
IIF(DateDiff("d", Date(),CVDate([YourTextDate])) >14, "Overdue",
"Waiting")

--
Build a little, test a little.


blake7 said:
Hi All,
I have a text field formatted to date, the date is chosen using the date
picker, I would like to put another text box on the form to display the words
"overdue" if the the field displaying the date is greater than 14 days else
display "Waiting". Thanks in advance.
Regards
Tony
 
L

.Len B

You need an = in front of the IIF(DateDiff...

--
Len
______________________________________________________
remove nothing for valid email address.
| Hi Karl, Thanks for your reply, I have put the code below in an unbound
text
| box but when I view the form it just comes back with #NAME?, what have
i done
| wrong?
| Thanks. Tony
|
|
| IIF(DateDiff("d", Date(),CVDate([Sent Date])) >14, "Overdue",
"Waiting")
|
| "KARL DEWEY" wrote:
|
| > Try this --
| > IIF(DateDiff("d", Date(),CVDate([YourTextDate])) >14, "Overdue",
| > "Waiting")
| >
| > --
| > Build a little, test a little.
| >
| >
| > "blake7" wrote:
| >
| > > Hi All,
| > > I have a text field formatted to date, the date is chosen using the
date
| > > picker, I would like to put another text box on the form to display
the words
| > > "overdue" if the the field displaying the date is greater than 14
days else
| > > display "Waiting". Thanks in advance.
| > > Regards
| > > Tony
 
B

blake7

Hi Len, thanks for that, i put the equals in front of the code and it is now
only displaying "Waiting" no matter what date I enter into the text box ??
any suggestions!
Thanks
Tony
 
B

blake7

Hi Len / Karl thanks both for your help, i have sorted it now (just need to
shake my brain a little!!)
Thanks
Tony

blake7 said:
Hi Len, thanks for that, i put the equals in front of the code and it is now
only displaying "Waiting" no matter what date I enter into the text box ??
any suggestions!
Thanks
Tony

.Len B said:
You need an = in front of the IIF(DateDiff...

--
Len
______________________________________________________
remove nothing for valid email address.
| Hi Karl, Thanks for your reply, I have put the code below in an unbound
text
| box but when I view the form it just comes back with #NAME?, what have
i done
| wrong?
| Thanks. Tony
|
|
| IIF(DateDiff("d", Date(),CVDate([Sent Date])) >14, "Overdue",
"Waiting")
|
| "KARL DEWEY" wrote:
|
| > Try this --
| > IIF(DateDiff("d", Date(),CVDate([YourTextDate])) >14, "Overdue",
| > "Waiting")
| >
| > --
| > Build a little, test a little.
| >
| >
| > "blake7" wrote:
| >
| > > Hi All,
| > > I have a text field formatted to date, the date is chosen using the
date
| > > picker, I would like to put another text box on the form to display
the words
| > > "overdue" if the the field displaying the date is greater than 14
days else
| > > display "Waiting". Thanks in advance.
| > > Regards
| > > Tony



.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top