View Single Post
  #12  
Old May 16th, 2010, 10:02 AM posted to microsoft.public.access.forms
Bob H[_4_]
external usenet poster
 
Posts: 161
Default out of date items

On 16/05/2010 00:31, Bob Quintal wrote:
Bob wrote in
:

On 15/05/2010 19:58, Bob Quintal wrote:
Bob wrote in
:

Bob wrote in
:

On 15/05/2010 17:21, Bob Quintal wrote:
Bob wrote in
:

On 15/05/2010 12:35, PieterLinden via AccessMonster.com
wrote:
IIF(DateDiff("d", NextTestDate, Date())=7,"Out of Date
Soon","OKAY")

This works ok, but for items that are well out of date, or
past the NextTestDate, they were shown as OKAY, So I removed
that and now those said items are showing as blank in an
OutOfDate field I am using.

Is there a way of differentiating between items that are OKAY
and those that are out of date.

Thanks

First test for "Past Due", then your /Soon Due:.

iif( NextTestDate date(),"OverDue",iif(date()=
NextTestDate +7,"Due Soon","OK"))




Thanks , but I am getting missing operand error, or more
precisely

+operator, in an expression without a corresponding operand


sorry forgot some parentheses, Access was calculating the
difference
between the dates, returning true or false, then adding 7.

iif( mydate date(),"OverDue",iif((myDate-date()7),"Due
Soon","OK")

oops, change mydate to NextTestDate in both places.


Thanks, but now getting invalid syntax error message:
You may have entered an operand without an operator


Post the SQL, because it worked on my machine.


I can't post the SQL because after I copied and pasted the line you
provided, with a change of Date name, I continually get the invalid
syntax error message and Access won't let me change to the SQL window.

This is thew line I have in Design View in the OutOfDate field:

OutOfDate:iif(
NextTestDateDate(),"OverDue",iif((NextTestDate-Date()7),"Due Soon","OK")

Thanks