Results 1 to 4 of 4
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    Syntax error

    I have a query that executes perfectly in query design mode, SQL:
    Code:
    SELECT FirstName, LastName, Month([DOB]) AS Mth, Day([DOB]) AS Dy
    FROM Registry WHERE ((Month([DOB]) = 1) AND (NOT [DOB] Is Null))
    ORDER BY Month([DOB]), Day([DOB]);
    But, when I try to duplicate the SELECT in code I get "Expected End of Statement". I've turned blue in the face trying to find the issue.



    Click image for larger version. 

Name:	000.jpg 
Views:	11 
Size:	98.5 KB 
ID:	48999

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    You need to put " & _ at the end of each line instead of " _
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Of course, I know that! Not been one of my better days.
    Thanks Colin,
    Bill

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    or & at the beginning of the next?

    & " FROM ...
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 15
    Last Post: 03-01-2021, 12:07 PM
  2. Replies: 6
    Last Post: 02-03-2020, 07:09 PM
  3. Replies: 5
    Last Post: 07-15-2019, 10:20 AM
  4. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  5. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 AM

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