Results 1 to 4 of 4
  1. #1
    yerromnitsuj is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    2

    Update with left function


    I have a column with a date in it, and the left four characters are the year. I want to add another column that is just the year. I've tried doing an update query and updating the year column to left(date,4) but it doesn't work. How should I go about updating my year column? Thanks for the help!

  2. #2
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,071
    Why? You can get the Year from any date field in a query, form or report by using the Year() Function. No reason to save it in your table.

  3. #3
    yerromnitsuj is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    2
    I imported the table from an SQL query. The date field was imported as text. I can't change the date field to date/time because the table is too large and I get the error that there isn't enough memory available to change it, so I am trying to just bring back the 4 left characters, which is the date.

  4. #4
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,071
    First how big is the database. The error you're getting doesn't necessarily mean that the table is to large. Could be something else. I've had that issue where the database was not that large but one of the processes I used created a large temporary file that exceeded the available memory. Try the following:

    Create a new database. link to the existing table. Create a Maketable query that adds all of the fields in the linked table.
    for the date field columns use Newfieldname:CVDate(oldfield) and run the query if the data checks out delete the link and the old DB.

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

Similar Threads

  1. Undefined Function "Left" in Expression
    By krueck in forum Access
    Replies: 4
    Last Post: 09-30-2011, 10:50 AM
  2. Replies: 3
    Last Post: 02-02-2011, 01:00 PM
  3. running a function after update
    By jamin14 in forum Programming
    Replies: 9
    Last Post: 04-06-2010, 09:40 AM
  4. Update with LEFT JOIN
    By mcarthey in forum Access
    Replies: 1
    Last Post: 08-27-2008, 10:49 AM
  5. Left function with various lenth of digits
    By mohsin74 in forum Queries
    Replies: 0
    Last Post: 07-10-2007, 02:00 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