Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2012
    Posts
    85

    Unanswered: syntax error in sql subquery

    Hey, I cant seem to find where the syntax error is in this SQL subquery.

    Code:
    (SELECT Peak
    FROM qryPrep AS Alias 
    WHERE MonthlyDate = 
    (SELECT Max(MonthlyDate) 
    FROM qryPrep AS Alias2 
    WHERE Alias2.MonthlyDate < qryPrep.MonthlyDate 
    AND Alias2.ProductID = qryPrep.ProductID) ) As Prior
    thanks,
    Mike
    ________

  2. #2
    Join Date
    Nov 2011
    Posts
    413
    Have you tried debugging?

  3. #3
    Join Date
    Jun 2012
    Posts
    85
    found the error in an underlying query,
    Mike
    ________

  4. #4
    Join Date
    Nov 2011
    Posts
    413
    Glad you got it working. Good luck with your project.

Posting Permissions

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