Results 1 to 2 of 2
  1. #1
    mike02 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    245

    syntax issue when searchin dates

    Hey, I am having syntax issues, can someone please take a look.

    MySelector is a Number

    and cboMonthlyDate is a Date

    Thanks.

    sSQL = "SELECT InvestmentID FROM Matrix WHERE ClientID = & " MySelector " & And MonthlyDate = & " cboMonthlyDate " & GROUP BY InvestmentID ORDER BY InvestmentID;"
    Set rst = db.OpenRecordset(sSQL)

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    sSQL = "SELECT InvestmentID FROM Matrix WHERE ClientID = " & MySelector & " And MonthlyDate = #" & cboMonthlyDate & "# GROUP BY InvestmentID ORDER BY InvestmentID;"

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

Similar Threads

  1. Access Query Issue with 2012 dates
    By gtrudel in forum Access
    Replies: 2
    Last Post: 04-16-2012, 05:35 PM
  2. Query input dates for range of dates in two fields
    By kagoodwin13 in forum Queries
    Replies: 3
    Last Post: 02-13-2012, 04:25 PM
  3. Mixed dates - show only complete dates?
    By weeblesue in forum Queries
    Replies: 3
    Last Post: 10-27-2010, 02:15 PM
  4. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 AM
  5. Replies: 0
    Last Post: 07-27-2009, 07:51 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