Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Updating a year (Access 2002)

    How do you update just the year value? I have a tblCompanyFacts which has just 1 record which for one thing holds the fiscal year start and ending dates (two different fields). I want to be able to automatically update these values with a button click. Can anyone direct me in the right direction on how to do the update. Thanks Fay.

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Updating a year (Access 2002)

    Use the DateAdd function either in an update query or in code. A typical DateAdd to change the year would be something like this:

    DateAdd("yyyy",1,[StartDate])
    Charlotte

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating a year (Access 2002)

    Thank you Charlotte and Ricky. It is a major help when you know what the words are that you need to lookup.

    Thank you for saving me a lot of time. Fay

  4. #4
    Star Lounger
    Join Date
    Dec 2001
    Location
    Birmingham, Alabama USA
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating a year (Access 2002)

    Not sure what you are doing ... I assume you want to add a year to it.

    You can use an Update query in conjuction with the DateAdd() function to do what you ask.
    You can search Access Help files on "DateAdd" to get the needed syntax.

    HTH
    RDH
    Ricky Hicks
    Microsoft MVP
    Birmingham, Alabama USA

  5. #5
    Star Lounger
    Join Date
    Dec 2001
    Location
    Birmingham, Alabama USA
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating a year (Access 2002)

    LOL .... It is almost as hard to learn how to use Access Help as it is to learn how to write code in Access.

    You are welcome for the help I've given ..... <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    RDH
    Ricky Hicks
    Microsoft MVP
    Birmingham, Alabama USA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •