Results 1 to 6 of 6
  1. #1
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Code / Syntax Problem (A2K SR1)

    The last line of this code causes a syntax error when run. Any ideas why as I have stared at this too long.
    <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23>

    strSql = "SELECT [2002 May].TASK_UID," _
    & "[2002 May].CWBS, [2002 May].[Planned Finish]," _
    & "[2002 May].[Baseline Finish]," _
    & "[2002 May].[Percent Complete] INTO CurrentData" _
    & " FROM [2002 May]" _
    & "WHERE" _
    & "([2002 May].CWBS) Not In (' ','C') AND" _
    & "([2002 May].[Percent Complete])<>100 AND" _
    & "([2002 May].TASK_IS_CRITICAL)=-1 AND" _
    & "([2002 May].TASK_IS_SUMMARY)=No AND" _
    & "LEFT([2002 May].CWBS,1) IN ('C');"
    Regards,

    Gary
    (It's been a while!)

  2. #2
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    NYC,USA,Earth
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Code / Syntax Problem (A2K SR1)

    Put a space before "LEFT".

  3. #3
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Code / Syntax Problem (A2K SR1)

    Thanks,

    Now that you mention it, I can't figure out why I didn't see this.

    <img src=/S/scream.gif border=0 alt=scream width=15 height=15> - that's me when I realized how easy this was to fix..... I will now return to my corner and hide from embarrassment <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>
    Regards,

    Gary
    (It's been a while!)

  4. #4
    2 Star Lounger
    Join Date
    Feb 2002
    Location
    Blacktown, Sydney, New South Wales, Australia
    Posts
    175
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Code / Syntax Problem (A2K SR1)

    Don't feel so bad. Been there many times. It's called 'can't see the wood for the trees', and the very reason why I use this forum.

  5. #5
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    NYC,USA,Earth
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Code / Syntax Problem (A2K SR1)

    Just FYI I took your code put in a module followed by Debug.Print strSQL and ran it. I was able to find the error by looking at the resulting string in the debug window.

    If I had a nickel for every little error I missed I wouldn't be typing into this computer right now <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  6. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Code / Syntax Problem (A2K SR1)

    It's good to see the Big Guns are human too.
    Pat <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

Posting Permissions

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