Results 1 to 4 of 4
  1. #1
    vjboaz is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2008
    Posts
    3

    Use a date from a form as criteria against a calculated field

    I am trying to retrieve records that have an End Date - which is calculated: EndDate: DateAdd("m",[Duration],[Start_Date]) with the criterion of <[Forms]![frmRequest]![Proposed_Start_Date].

    I get the error message:

    "The expression is typed incorrectly, or is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables."

    Code:
    SELECT ActiveTeamRoster.ID, [Last Name] & ", " & [First Name] AS Resource, ActiveTeamRoster.Role, DateAdd("m",[Duration],[Start_Date]) AS EndDate
    FROM Assignment INNER JOIN ActiveTeamRoster ON Assignment.ID = ActiveTeamRoster.ID
    WHERE (((DateAdd("m",[Duration],[Start_Date]))<[Forms]![frmRequest]![Proposed_Start_Date]));
    Can someone please help me?



    veejay

  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,870
    Is the form open when you tried to run this?
    How is Duration dimmed/defined?
    Please show your table definitions.

  3. #3
    vjboaz is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2008
    Posts
    3
    The form is open when I try to run it.
    Duration is defined as Number - Long Integer.

    Thanks!

    veejay

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    What are the ID fields? If they are both autonumber, should not be joining on two autonumber fields.
    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. Query with criteria a date field of a form
    By panoss in forum Queries
    Replies: 1
    Last Post: 12-22-2014, 09:03 AM
  2. Replies: 5
    Last Post: 07-02-2014, 07:13 AM
  3. Replies: 3
    Last Post: 04-01-2012, 01:40 PM
  4. Replies: 1
    Last Post: 05-05-2010, 01:54 AM
  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