Share via

Syntax Error (Comma) in Query Expression

Anonymous
2014-09-05T17:15:33+00:00

Trying to parse the first two sections of a five section string.  Now getting a SYNTAX ERROR (COMMA).  I've looked at it too long.  Can someone please take a look and give me a hand.

 Left((([ArborID],InStr([ArborID],"-")+1,(InStr(InStr([ArborID],"-")+1,[ArborID],"-")-InStr([ArborID],"-"))-1)),10)

Thanks

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2014-09-05T19:31:51+00:00

    Yes it is!

    I don't do this all the time.  I'm an engineer that happens to mess with IT some.  Therefore, you know how companies work, "Oh, yeah, he can do that for us!"  Then, it's been months since you did anything but input data and all of a sudden you go brain dead.

    Thanks much for your help and have a Blessed Day!

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2014-09-05T18:39:14+00:00

    ROFLOL

    Isn't it just too weird that you already answered your own question and just needed a whack up side the head to see it.  Priceless!

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2014-09-05T18:26:04+00:00

    I am using this string in an expression in a query to separate "XXX??-XX?-ZZZ-ZZZ?".  the desire is to pull everything left of the second "-".  The second section of the string can be 2 or 3 digits and the first is 3 to 5 alpha characters.

    BAM!

    Your comment has made me see my errant ways.  My table design isn't be, this is actually a concatenated field.  Not sure why I'm trying to pull this data apart when I already have it in separated fields.  Sometimes we just get off on the wrong track and don't see the train coming.

    Thanks!  I'm going to clear my head and think logically again.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2014-09-05T18:12:06+00:00

    Please describe in words along with a few examples of what this expression is supposed to do.

    As it is, it doesn't make sense, but I'm guessing you want part of the ArborID between, before or after some number of dashes.

    If that's a reasonably close guess, then it's a poor table design issue in that there is more than one value in the ArborID field.  Instead you should have two or three fields, each with the individual parts of the ArvorID.  Then you wouldn't need to parse the field and it would be a trivial expression to put the parts together on forms/reports whenever people need to see it.

    Was this answer helpful?

    0 comments No comments