P
PayeDoc
Hello All
What's wrong with this:
SELECT staffs.DOB, CDate(retirementdate([dob],[sex])) AS retdate
FROM staffs
WHERE (((staffs.DOB)<>#1/1/1901#) AND
((CDate(retirementdate([dob],[sex])))>#7/7/2010#));
My function 'retirementdate' works elsewhere perfectly, and definitely
returns a date - the CDate above should be superfluous, but it's there
bacause I keep getting a "data type mismatch in criteria expression"
message, so I wanted to 'force' it to be a date (which it already is!).
Initially the crieria for retirementdate([dob],[sex]) was an expression
derived from a date field on a form, but I kept getting the error and
gradually simplified the criteria, until it is now >#7/7/2010#: can't get
much simpler than that!
Hope someone can help.
Many thanks
Les
What's wrong with this:
SELECT staffs.DOB, CDate(retirementdate([dob],[sex])) AS retdate
FROM staffs
WHERE (((staffs.DOB)<>#1/1/1901#) AND
((CDate(retirementdate([dob],[sex])))>#7/7/2010#));
My function 'retirementdate' works elsewhere perfectly, and definitely
returns a date - the CDate above should be superfluous, but it's there
bacause I keep getting a "data type mismatch in criteria expression"
message, so I wanted to 'force' it to be a date (which it already is!).
Initially the crieria for retirementdate([dob],[sex]) was an expression
derived from a date field on a form, but I kept getting the error and
gradually simplified the criteria, until it is now >#7/7/2010#: can't get
much simpler than that!
Hope someone can help.
Many thanks
Les