Results 1 to 4 of 4
  1. #1
    TracyBell is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2011
    Posts
    23

    Sorting by month and day - without year

    I have a birthdate field which I want to sort by in a report, but I only want it to sort by the month and day - not the year. Is there a way to do this? Do I have to create a query which splits the field somehow? If it's not possible, is there a way to automatically split that field into two or three separate fields, either as one for month and day and the other for year or a separate field for each piece of the date?



    Thanks in advance for your help with what's probably a newb question!

  2. #2
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    In a query, use the date functions Month() and Day()........see Help.

    Example:

    If you have a field named DOB (date of birth), the query might look like

    Code:
    SELECT Employees.EmpLName, Employees.EmpFName, Employees.EmpDOB, Month([EmpDOB]) AS BirthMonth, Day([EmpDOB]) AS BirthDay
    FROM Employees
    ORDER BY Month([EmpDOB]), Day([EmpDOB]);
    (This is one reason why objects should not be named "Month", "Year" or "Day")

  3. #3
    TracyBell is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2011
    Posts
    23
    thanks for your help! It works great.

  4. #4
    DetailDiva is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2011
    Posts
    1

    Question grouping and breaking when sorting by month and day without yeaer

    I'm an Access newbie, and I apologize for my ignorance with this program and with forum etiquette in general........

    I used Sql back in the days of DOS with a database, and now I'm trying to translate that knowledge into Access format. I've searched high and low for the information on sorting without year....thanks for the help on that!! I'm making progress slowly but surely.

    I can't figure out how to use the group on function in Access......it appears that you leave it blank if you don't want it to group on that field. Correct? Anyway, the real issue is this......how do I get a page break between months? I've tried adding it directly into the SQL view, with no luck.

    I've attached a file with a screen shot of the simply query I'm working on. Any help you can offer would be greatly appreciated!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Month/Year lookup for combo box
    By Buakaw in forum Forms
    Replies: 7
    Last Post: 03-01-2011, 09:49 PM
  2. Track capacity changes month by month
    By Nils in forum Database Design
    Replies: 1
    Last Post: 02-18-2011, 03:03 PM
  3. default month and year
    By beefyalby in forum Forms
    Replies: 3
    Last Post: 12-05-2010, 11:40 PM
  4. Replies: 5
    Last Post: 11-15-2010, 06:12 PM
  5. by year by month
    By nkuebelbeck in forum Reports
    Replies: 21
    Last Post: 03-24-2010, 01:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums