Results 1 to 2 of 2
  1. #1
    razkowski is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2012
    Posts
    16

    Problem with a DateSerial Function

    Hello-

    I'm having trouble with a DateSerial function. Actually, the function itself is working fine. The problem is when I use a second query with the "between and" function that i run into problems.

    So, I'm using query 1 with the DateSerial function to adjust dates saved as text (example "20110401") to short date format ("4/1/2011"). That is working fine. However, in query 2, i use that adjusted date field with a "between and" criteria ("Between #1/1/2011# and Date()). This appears to work at first as the results load and look normal. However, if I try to work with the results at all (click the arrow for the last field, try to auto fit all fields etc), the "Data type mismatch in criteria expression" error appears and all fields change to "#Name?"

    I'm sure this is due to an issue with the DateSerial adjusted dates but I don't know what to do to fix.

    I appreciate any help that can be provided.

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Maybe you could wrap the date serial function in the CDate() function

    CDate(DateSerial(yyyy,mm,dd))

    Would have to see the SQL for Query1 and query2.

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

Similar Threads

  1. DateSerial Format
    By venu_resoju in forum Reports
    Replies: 4
    Last Post: 01-19-2013, 02:20 AM
  2. Problem with function?
    By devxweb in forum Access
    Replies: 2
    Last Post: 01-07-2013, 08:43 AM
  3. Replies: 2
    Last Post: 08-07-2012, 02:02 PM
  4. VBA Function problem
    By smikkelsen in forum Programming
    Replies: 5
    Last Post: 07-16-2010, 07:46 AM

Tags for this Thread

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