Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Nov 2003
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date Fields (97)

    Hi can anyone help. I hav a db with three fields - DOBDay, DOBMonth and DOBYear. How can I truncate this into one field with a date format ## / ## / ####? Thanks

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

    Re: Date Fields (97)

    I assume that DOBDay is a numeric field with values 1...31, DOBMonth is a numeric field with values 1...12, and DOBYear is a numeric field with values like 1970. If not, please post back and provide detailed information.

    Create a query on the table*. Add a calculated column to the query grid:

    DOB: DateSerial(DOBYear, DOBMonth, DOBDay)

    Set the Format property of this field the way you want it. If you base your forms and reports on the query instead of the table, you can display the complete date.

    <img src=/w3timages/blueline.gif width=33% height=2>

    * Pedantic footnote: a database is a collection of tables, queries etc. A database doesn't have fields, but a table does.

  3. #3
    Lounger
    Join Date
    Nov 2003
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Fields (97)

    Actually, just to make it interesting the fields are textual at the moment, but I can get round that. Thank you.

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

    Re: Date Fields (97)

    If DOBMonth contains a month name, such as "Dec" or "December", you can probably use

    DOB: DateValue(DOBDay & " " & DOBMonth & " " & DOBYear)

Posting Permissions

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