Results 1 to 4 of 4
  1. #1
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199

    How can I combine two text fields and format as a date?

    Hello, how can I combine two text fields and format them as a date.



    Text Field 1: Jan
    Text Field 2: 2014

    Desired Output Jan-2014 (being an actual date field)

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    [Field1] & "-" & [Field2]

    The result will be a string, not a true date. If you need a true date then won't look like that.

    DateSerial([field2],[field1],1)
    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
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199
    Thanks June7, I've tried Date Serial but it's requiring that I put a "day" field in which I presume is the "1" in your example. Doing that through an #Error in the output though. Any thoughts?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Ooops, DateSerial() doesn't recognize the alpha month. Try:

    CDate(Field1 & "/1/" & Field2)

    However, that will error if any field is Null.
    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. How can I combine two text fields into a third?
    By accessmatt in forum Queries
    Replies: 0
    Last Post: 09-16-2014, 08:29 AM
  2. Replies: 1
    Last Post: 02-16-2013, 09:11 AM
  3. format text string as date
    By rbrem in forum Access
    Replies: 2
    Last Post: 08-28-2012, 08:39 AM
  4. tRNASFER text FILEd INTO DATE FORMAT
    By BorisGomel in forum Access
    Replies: 1
    Last Post: 01-05-2012, 10:08 AM
  5. combine text fields
    By joemills62 in forum Forms
    Replies: 6
    Last Post: 08-30-2011, 09:07 AM

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