Closed Thread
Results 1 to 2 of 2

Thread: Data Type Mismatch in Criteria Expression

  1. #1
    Barnie alansidman is on a distinguished road alansidman's Avatar
    Join Date
    Apr 2008
    Location
    Lake County, IL
    Posts
    25
    Real Name
    Alan
    Rep Power
    4

    Data Type Mismatch in Criteria Expression

    Ok guys, this has me stumped. The title is the message I get for some of the queries I have written. I have a table with some dates and names in it. In particular I want to know all the applications that have been executed in the prior month.
    I have an expression:
    Expr1: IIf(Format([ndaDteEx],"mm")<10,Mid("00" & Format([ndaDteEx],"mm"),3) & Format([ndaDteEx],"yyyy"),Format([ndaDteEx],"mm") & Format([ndaDteEx],"yyyy"))
    In the criteria:
    IIf(Format(Date(),"mm")<10,Mid("00" & Format(Date(),"mm")-1,2) & Format(Date(),"yyyy"),Format(Date(),"mm")-1 & Format(Date(),"yyyy"))
    There are several tables and I run a similar query against each one with only the field name changed appropriately. Some of the queries appear to run fine, and others give me the error message.

    Your thoughts???
    Alan

  2. #2
    Barnie alansidman is on a distinguished road alansidman's Avatar
    Join Date
    Apr 2008
    Location
    Lake County, IL
    Posts
    25
    Real Name
    Alan
    Rep Power
    4

    I found the answer. In setting up the db, I had left some empty fields that were actually populated with blanks ie. "" in some date fields. This resulted in the error message. Once the fields and records were deleted, the queries ran as designed.
    Alan

Closed Thread

Similar Threads

  1. Type mismatch: HTMLEncode
    By Rebelle in forum ASP Development
    Replies: 20
    Last Post: March 28th, 2008, 10:30 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO