Results 1 to 4 of 4
  1. #1
    DavidAlan is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    4

    Smile field parts

    I have a text field showing dates as 12/15/10 or 7/5/10 (not 07/05/10).



    Need to extract the month part and the day part. cannot convert field to DATE data type - nor will a date part function work due to single digits entered for some.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Will the CDate() function work? If not, you're probably looking at a custom function using the Split() function. You might be able to use Left() and Mid() along with the InStr() function to find the position of the first "/" and the InStrRev() function to find the last.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    DavidAlan is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    4

    Date part

    Problem is they set field as TEXT, then included other stuff in it -
    for example:

    3/15/10 1:15 pm
    3/21/10 north of town
    5/12/10 (or 5/13/10 after midnight?)

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Ah, a moving target. If the space is reliably there, you can still try CDate() after using Left() with the InStr() function to find the space. Otherwise you're probably looking at a custom function to handle the various possibilities the field could contain.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 04-26-2010, 11:38 AM
  2. Replies: 10
    Last Post: 04-21-2010, 01:16 PM
  3. Find all parts in a heirarchy
    By Spiftacu1ar in forum Queries
    Replies: 1
    Last Post: 08-04-2009, 09:01 AM
  4. Replies: 1
    Last Post: 02-26-2009, 11:31 AM
  5. Quick way to stuff field names into text field
    By kfinpgh in forum Programming
    Replies: 0
    Last Post: 01-04-2007, 01:13 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