Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Aug 2006
    Location
    Gtr London, England
    Posts
    256
    Thanks
    2
    Thanked 0 Times in 0 Posts

    New Year (Access 2003)

    Hi,

    I currently have a number of reports that requires the user to choose the month and year. The problem being that the year only goes up to 2007 and in a few weeks this will be passed.

    It seems that the same problem arose last year and the reports had to be amended to show 2007.

    I assume there is syntax that would give the option for the current year, so that when the year changes the current year shows automatically?

    Any help will be much appreciated.

    Regards.
    Lee

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Lewes, East Sussex, Sussex, United Kingdom
    Posts
    232
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: New Year (Access 2003)

    Lee

    Using the function Year(Date) will give you the current year

    Nick

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: New Year (Access 2003)

    To expand on Bodders' reply, if you want to use the current year in the criteria of a query, use
    <code>
    Year(Date())
    </code>
    You can use <code>Date</code> to refer to the current date in VBA, but in an expression in a query you need to use <code>Date()</code>.

  4. #4
    3 Star Lounger
    Join Date
    Aug 2006
    Location
    Gtr London, England
    Posts
    256
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: New Year (Access 2003)

    Hi Bodders (Nick),

    Many thanks for the syntax.

    Cheers.
    Lee

  5. #5
    3 Star Lounger
    Join Date
    Aug 2006
    Location
    Gtr London, England
    Posts
    256
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: New Year (Access 2003)

    Hi Hans,

    Many thanks for the tip.

    Best Regards.
    Lee

Posting Permissions

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