Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Mar 2004
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Syntax Help (2003)

    I know the solution is staring me in the face, but does anyone know what I've missed here? Thanks.

    strSQL = "(SELECT * FROM Portfolio2004 WHERE ([Maturity Date]>= "& Chr(35) _
    & beginningmonthdate & Chr(35)")) UNION (SELECT * FROM Portfolio2004 _
    (WHERE [Sold Date] BETWEEN "& chr(35) & endingmonthdate & chr(35) & _
    AND & chr(35) & beginningmonthdate & chr(35)"))"

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Syntax Help (2003)

    Lots of missing quotes and ampersands, and a misplaced parenthesis. Try

    strSQL = "(SELECT * FROM Portfolio2004 WHERE ([Maturity Date]>= " & Chr(35) _
    & beginningmonthdate & Chr(35) & ")) UNION (SELECT * FROM Portfolio2004 " & _
    "WHERE ([Sold Date] BETWEEN " & Chr(35) & endingmonthdate & Chr(35) & _
    " AND " & Chr(35) & beginningmonthdate & Chr(35) & "))"

Posting Permissions

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