Results 1 to 8 of 8
  1. #1
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Trim Date from field

    I have a lot of records where I need to update the Year on a date table and the field name is CalendarDate and i need to update the year to 2012. The table being used is named tblcaldate. Here is a screenshot.
    Attached Thumbnails Attached Thumbnails calendartable.jpg  

  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,652
    You can use the DateSerial() function, using Month() and Day() for those arguments and hard-coding the year.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Tried using this is a update query but it is wrong syntax, close, but no cigar!
    Criteria 2013
    =Right("CalendarDate",4)

  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,652
    No, the DateSerial function would be the way to go.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    peaceup is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2013
    Posts
    2
    Hello
    use Query Update
    see attach picture
    Attached Thumbnails Attached Thumbnails UpDate3.JPG  

  6. #6
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    The actual name of my field is CalendarDate I assume I replace datestg with CalendarDate is this correct ?
    Last edited by burrina; 01-02-2013 at 03:01 PM. Reason: Worked; Thanks

  7. #7
    peaceup is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2013
    Posts
    2
    yes,
    CalendarDate
    tblcaldate
    DateAdd("yyyy";3;[
    CalendarDate])

  8. #8
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Thanks, I appreciate that, it saved me a ton of work.

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

Similar Threads

  1. Trim!
    By redbull in forum Programming
    Replies: 9
    Last Post: 11-06-2012, 06:01 AM
  2. Replies: 2
    Last Post: 03-31-2012, 07:53 AM
  3. Trim vba
    By shexe in forum Access
    Replies: 5
    Last Post: 11-16-2011, 10:20 AM
  4. Start and End Date trim.
    By jon6035 in forum Queries
    Replies: 7
    Last Post: 09-28-2011, 05:07 PM
  5. Trim value
    By dada in forum Programming
    Replies: 5
    Last Post: 09-02-2010, 11:01 PM

Tags for this Thread

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