Results 1 to 4 of 4
  1. #1
    tyguy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2011
    Posts
    12

    Date criteria on DateAdd calculated query field not working

    This should be really simple but I can't figure it out.. I have a calculated date field in my query using the DateAdd function. I'm using a parameter for this query. When the parameter pops up, and I enter a date, it doesn't return the proper dataset, but rather the entire dataset. Am I missing something really obvious here? I feel like something isn't in the correct format. This is a date field in Access so I'd assume the DateAdd() function preserves that format, correct?



    Click image for larger version. 

Name:	2015-06-25_15-08-12.gif 
Views:	12 
Size:	2.9 KB 
ID:	21096

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I NEVER use dynamic parameterized queries. I prefer: http://www.allenbrowne.com/ser-62.html

    I'm not having any luck either. I tried "#" & [Enter date] & "#" as well as CDate() on the DateAdd expression.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    IrogSinta is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jun 2015
    Posts
    103
    I just tried this and had no problem. The dates returned were fine. Can you give a sample of Class_StartDates in your table and the parameter you are entering?

    Ron

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I entered 1/1/2000 and results are not filtered. I know this should work but can't see why it is failing.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 3
    Last Post: 02-26-2015, 11:01 AM
  2. Replies: 7
    Last Post: 02-09-2015, 12:35 PM
  3. Replies: 20
    Last Post: 01-13-2015, 02:23 PM
  4. Replies: 5
    Last Post: 08-20-2014, 10:18 PM
  5. Setting criteria in a calculated date field
    By SteveReberger in forum Access
    Replies: 0
    Last Post: 10-29-2008, 06:58 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