Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2005
    Posts
    183

    Unanswered: Left Function going Mental

    Had this been a monday, I wouldn't mind this type of nag:

    I'm using the left function to get the leftmost 9 characters of s tring. Something blindingly simple, but apparently I get a syntax error no matter how I rewrite this:

    =(Left(str([TestID]), 9))

    Also trie

    =Left(str([TestID]), 9)
    =Left([TestID], 9)

    Hubub? Gibbeblibplop? I'm going thermonuclear here... why am I get a syntax error on the Left function given the examples above? Its usually so bloody simple.

    I'm an inch from converting the whole shabang to T-SQL... I'm fed up with acces..

    P.S. Just tried the Mid and Right functions as well.. its all in a query btw, an update statement update a field with parts of another.
    And the worst part is, that the bug is probably my own, I'm justing having a shitty day.
    Last edited by Trinsan; 11-09-05 at 04:44.
    IT squid: networks, servers, firewalls, routers and I dabble a little with SQL-server and Access as well....

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    Try:

    Left(Nz([TestID], 0), 9)

    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  3. #3
    Join Date
    Oct 2005
    Posts
    183
    Syntax error as well..

    Have they removed the string operators from Access 2003?

    There's something just not right here... Len function works though.
    IT squid: networks, servers, firewalls, routers and I dabble a little with SQL-server and Access as well....

  4. #4
    Join Date
    Oct 2005
    Posts
    183
    I just can't believe it... Access uses semicolon ; as the separator, not comma. Since when did this happen in VB? apparently this morning :-)
    IT squid: networks, servers, firewalls, routers and I dabble a little with SQL-server and Access as well....

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Uhhhhh... no it doesn't... You must have something configured strange in your VBE. Unless there's some sort of bizarre region specific thing...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  6. #6
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    i just tried the following in saved A query talking to a JET table
    UPDATE gash SET gashDesc = Left$(gashDesc, 6) ;
    ...it worked fine.

    and in the immediate window
    currentdb.Execute "UPDATE gash SET gashDesc = Left$(gashDesc, 4);
    ...which also worked fine


    ...meanwhile check out Teddy's signature.

    Left() is not a string function or operator.
    Left$() is {and BTW works radically faster on strings than does Left()}

    what is the datatype of the field you are trying to SET


    izy
    currently using SS 2008R2

Posting Permissions

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