Results 1 to 6 of 6
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Changinf dd/mm/yyyy to dd/mm only in Query? (2003)

    You can set the Format property of the birthday field to dd/mm. The underlying values will still contain the year. If you really need to store only the day and month, you'll need to do so in a text field, since a date/time field always includes a year. You can use Format([BirthDate],"dd/mm") to obtain the text value.

  2. #2
    Lounger
    Join Date
    Aug 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Changing dd/mm/yyyy to dd/mm only in Query? (2003)

    I am pulling some data from a table with employee data in it. Included is the birthday for each employee. I need to get the data to another table or query minus the year. In short I need to change "01/01/2005" to "01/01" only. Can anyone tell me how to do this?

  3. #3
    Lounger
    Join Date
    Aug 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changinf dd/mm/yyyy to dd/mm only in Query? (2003)

    Yeah I though of that but if I change the date/time format to dd/mm it still displays the year down the road on the webpage that acesses the data. The other suggestion using the "Format([BirthDate],"dd/mm")" method I have not tried. Where would I input this? I am sorry, I am not much of an access person.

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

    Re: Changinf dd/mm/yyyy to dd/mm only in Query? (2003)

    Create a query in design view, based on your table.
    Say that the date/time field in the table is named BirthDate (as in my example).
    Instead of adding BirthDate itself to the query design grid, add a calculated column:

    BirthDay: Format([BirthDate],"dd/mm")

    BirthDay will be the column title in the result. Add the other fields you need to the query design grid.

    You can use the query in the web page, or you can select Query | Make Table Query... and specify the name of a table to be created, then select Query | Run to create the table.

  5. #5
    Lounger
    Join Date
    Aug 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changinf dd/mm/yyyy to dd/mm only in Query? (2003)

    That solves the display problem but unfortunately it creates another. It I do this I then can not sort the data like a date. Currently my Query is this.

    Between DateAdd("m",1,Date()) And Date()

    If I format it as text then I loose this criteria capability and though there may be a way to work around this I am unfamiliar with it, access guru I am not [img]/forums/images/smilies/smile.gif[/img] I will keep plugging away at it though, thanks for all the help folks! Greatly appreciated, K

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

    Re: Changinf dd/mm/yyyy to dd/mm only in Query? (2003)

    You can add the birthdate column to the query grid, set its sort, and uncheck the Show checkbox. That will use the field for sorting but won't display it.
    Charlotte

Posting Permissions

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