Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date Format in Access 2000

    In a query I would like to be able to pull all records whose year is equal to the current year. The field format in mm/dd/yyyy. Can't remember if I use Date Part, now(), or what??

    Thanks!!

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    La Verne, California, USA
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Format in Access 2000

    I'd would just use >12/31/2000 in the criteria grid of the query.

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Format in Access 2000

    Thanks - I was doing that but I didn't want the user next year to have to have to remember to change criteria! I was hoping to make the year equal to current year.

    ss [img]/forums/images/smilies/smile.gif[/img]

  4. #4
    2 Star Lounger
    Join Date
    Dec 2000
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Format in Access 2000

    USE:
    Year([YourFieldHere])=Year(Date())

    This will work. It assumes your field is a Date/Time field, and your computer's date is correct. Look for a great, more complete set of example date criteria in the Online Help.

    In the Online Help, choose the Contents Tab, then find the "book" called "Working with Queries", then find the one called "Performing Calculations", next click on "Examples of Expressions Used in Queries and Filters, next click on "See examples of expressions that perform calculations or manipulate field values, then finally, click on "See examples of expressions that manipulate and calculate dates"
    WHEW!

    HTH
    TomG (I was in the neighborhood)

  5. #5
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Youngstown, Ohio, USA
    Posts
    705
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Date Format in Access 2000

    A slight problem exists when you use a formula like Year([YourFieldHere])=Year(Date()). Early January, you may still be needing a report generated on the previous year.

    To remedy this, you could create a duplicate query --Qry_Current_Year & Qry_Prior_Year. To pull a report for the prior year, just modify TomG's formula to Year([YourFieldHere])=Year(Date())-1.

Posting Permissions

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