Date Difference

  • Thread starter Thread starter blake7
  • Start date Start date
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
 
Try this --
IIF(DateDiff("d", Date(),CVDate([YourTextDate])) >14, "Overdue",
"Waiting")
 
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
 
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
 
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
 
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



.
 
Back
Top