Results 1 to 4 of 4
  1. #1
    Join Date
    May 2006
    Posts
    28

    Question Unanswered: Date() Query question (not working properly)

    Hi, I use this
    Code:
    Today: Format(Date(),"dd-mmm")
    to format the date as dd-mmm and am using [Birthday] as the criteria in a query. Birthday is a field with dd-mmm as the format as well.

    When I run the query, it only pulls up entries that have 2008 as the year...

    Problem is, I didn't even know it was storing the year. When I view the data in the table, it only shows 3-Jan, not 1/3/2008. In the form, however, it does show as 1/3/2008 when I click out of the control.

    Any ideas - first as to why it defaults to 1/3/2008 on the form and also to how I can solve this problem. I don't want everyone to store their birthday's as 2008 - plus, I'll have to go back every year and do an update query to update the years to the current year which isn't good.

    Thanks for any help you can give me.

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    This works for me:

    Code:
    SELECT Format([DOB],"d-mmm") AS BDay
    FROM CLIENT
    WHERE Format([DOB],"d-mmm") = Format(Date(),"d-mmm");
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    May 2006
    Posts
    28
    cool! it worked! thanks!

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    You're welcome
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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