Results 1 to 4 of 4
  1. #1
    BigD is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    5

    Data Type Mis Match when I try to use "any" data type criteria on a working query

    I need a little help please. I have a query that is working as long as I do not try to use any criteria to filter the results. Two of the fields are expressions. 1. In the [QtrNextDue] field I use QtrNextDue: DatePart("q",[Next Due]) and in the [YrNextDue] field I use YrNextDue: DatePart("yyyy",[Next Due]) which works great as long as I do not use criteria to filter my results.

    This query is a query of a query which works fine. As a little back ground though... [Next Due] is an expression field. NEXT DUE: DateAdd("yyyy",[FREQUENCY],[REVISED]) which also works fine.


    So the problem:



    In the criteria in the [QtrNextDue] field I use 1, 2, 3, or 4 and I get the data mis-match error. I put a full date and get same error. I make the 1,2,3,4 text "1","2","3", or "4" and still get the error. It doesn't matter if I put an number, date, or text.

    Does anyone know what the fix would be?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    What exactly are you trying to do - in plain English-- forget the formula for a minute?

  3. #3
    BigD is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    5
    I am simply trying to filter the query by quarter and year in the criteria. For example 4 in QtrNextDue and 2013 in YrNextDue (The database is written in .mdb I just have 2010 on my system)

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Just a guess, but you may have to use more than 1 query.
    Seems you have a lot of calculations going on DateAdd DatePart even NextDue is calculated

    You may have to get all of your NextDue dates as Dates, then filter by Year, and then filter that by quarter.

    As I said, a guess.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to format a "Number" Data type
    By undee69 in forum Access
    Replies: 4
    Last Post: 12-16-2012, 10:20 PM
  2. Replies: 2
    Last Post: 05-17-2011, 02:40 PM
  3. Replies: 2
    Last Post: 03-18-2010, 08:24 PM
  4. data type mis match
    By cowboy in forum Programming
    Replies: 3
    Last Post: 03-12-2010, 11:54 AM
  5. aSTR = Dir("C:\*.*") >> "Type Mismatch"
    By JGrant in forum Programming
    Replies: 1
    Last Post: 03-28-2009, 05:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums