Results 1 to 4 of 4
  1. #1
    teirrah1995 is offline Advanced Beginner
    Windows XP Access 2002
    Join Date
    Sep 2010
    Posts
    35

    Separating a date into day, month and year

    I have a word document which links to a query in my table. In one section, it asks for the date of birth, and it must fit into certain boxes. On paper, it looks like:

    01 / 01 / 2001 (example)

    For it to print into these boxes, I think I need to separate 01/01/2001 into 01 and 01 and 2001.


    The data I need this to be filled with is "DOB" in the "Patient Number" query.
    Would really appreciate the help.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Use Month(), Day(), Year() functions to split up a date value. Example: Year([DOB])
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    teirrah1995 is offline Advanced Beginner
    Windows XP Access 2002
    Join Date
    Sep 2010
    Posts
    35
    Wow, that's simpler than I thought. Thank you. Do you know where you would put text like that (year([DOB])) if you were in MS Word?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Put it in the query. In design view, enter the expression in a cell of the Field row. Access will assign a generic name like Expr1. You may replace it with whatever you want, like YearDOB. Now you have a field available for Word to work with.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Sorting by month and day - without year
    By TracyBell in forum Access
    Replies: 3
    Last Post: 11-17-2011, 10:29 AM
  2. Current Month and Year-To-Date
    By DSnipeFunk in forum Access
    Replies: 4
    Last Post: 05-31-2011, 11:38 AM
  3. Replies: 2
    Last Post: 03-26-2011, 02:43 PM
  4. default month and year
    By beefyalby in forum Forms
    Replies: 3
    Last Post: 12-05-2010, 11:40 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