Date fields in expressions

Stuart Green

Registered User.
Local time
Today, 16:57
Joined
Jun 24, 2002
Messages
108
I am trying to work out the number of years since a client was contacted using the expression below in a query
where [lastcontact] is a date field.

contact: ((Date()-[lastcontact])/365)

This works fine until I try to put a criteria on it. If I want to see all those that it has been 3 years or more since I contacted them, then this works

>=3

But if I put in a prompt criteria [How many years since last visited] then I get wrong results, the equivalent of asking >="3"


Any pointers as to where I am going wrong please
 
Put in:

>=[How many years since last visited]
 
Jon K said:
Put in:

>=[How many years since last visited]

Sorry JON, missed the >= out when I typed. I have tried this but still get wrong data back, it gives the equivalent of putting in say "3" as opposed to the number 3
 
I'd rather use the DateDiff function but I suspect [last contact] is not a valid date field
 

Users who are viewing this thread

Back
Top Bottom