Results 1 to 2 of 2
  1. #1
    Juan4412 is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Dec 2010
    Posts
    209

    Add One Year To Query Field


    In my table I have a DateTime field, it only contains Dates. In the format of mm/dd/yyyy - In a query I need to display this field - then in the next query field I need to add one year to the field.

    Example if the table holds 02/24/2020 then I want the next query field to show 02/24/2021

    How would I add one year to a field in a query?

    I tried this, but I get the error 'The expression you entered contains invalid syntax'

    Code:
    Anniversary: DateAdd("yyyy", 1, [Joined]);

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    your expression is correct.

    it will fail if :
    [joined] is not a field
    or
    you actually have a semicolon there at the end

    is this SQL , or a query? Use a query.

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

Similar Threads

  1. Replies: 16
    Last Post: 02-07-2020, 11:42 AM
  2. Replies: 2
    Last Post: 12-24-2018, 05:12 PM
  3. Replies: 2
    Last Post: 04-19-2017, 01:09 PM
  4. Crosstab Fiscal Year on Year Query
    By DJF in forum Queries
    Replies: 1
    Last Post: 02-07-2017, 09:27 AM
  5. Replies: 7
    Last Post: 06-07-2015, 11:57 PM

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