Query help needed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hey there, I posted this a couple of days ago but was sick yesterday and
haven't had time to work on it. I'm trying to get the newest record from a
table where a given condition is true. Can someone please tell me what is
wrong with this SQL statement?

SELECT *
FROM Approval_Sales_Given
WHERE Approval_Sales_Given.Approval_Date = MAX
(Approval_Sales_Given.Approval_Date)
FROM Approval_Sales_Given
WHERE (((Approval_Sales_Given.Approval_Action) Like "Given") AND
((Approval_Sales_Given.Quote_Number) Like
[Forms]![Quote_Invoice_Manager]![Quote_Invoice_ID]));
 
Worked it out, thanks. Brackets.... =)

nick said:
Hey there, I posted this a couple of days ago but was sick yesterday and
haven't had time to work on it. I'm trying to get the newest record from a
table where a given condition is true. Can someone please tell me what is
wrong with this SQL statement?

SELECT *
FROM Approval_Sales_Given
WHERE Approval_Sales_Given.Approval_Date = MAX
(Approval_Sales_Given.Approval_Date)
FROM Approval_Sales_Given
WHERE (((Approval_Sales_Given.Approval_Action) Like "Given") AND
((Approval_Sales_Given.Quote_Number) Like
[Forms]![Quote_Invoice_Manager]![Quote_Invoice_ID]));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top