Datatype mismatch in criteria

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Snoopy33

    Datatype mismatch in criteria

    I have a query that builds a date from a text field with the date
    imput as yyyymmdd in the query, so i have to piece it together in my
    expression as follows:

    exp: FormatNumber(Da teDiff("d",Date Serial(Left([package activity date],
    4),Left(Right([package activity date],4),2),Right([package activity
    date],2)),Now())))


    if i don't use a criteria, it works fine. when i try to use the
    criteria <7 is when i get the error. It will show the correct records
    for a few seconds prior to getting the error, but then i get an error
    "datatype mismatch in criteria".

    I've tried it with and without the formatnumber function, with and
    without the dateserial function (rearranging the expression) and still
    get the error.

    Any help?
Working...