select - MS Access INNER JOIN most recent entry -


I'm having trouble trying to accept my SQL query on Microsoft Access 2007 but this is to throw syntax errors for me

I have two tables, let them easily call customers and commands.

I need some customer details, but some details are also the most recent order I currently have such a query:

  SELECT c.ID, c. Name, c.Address, o.ID, o.Date, o Customers filled with customers Price Inline Order Order on O CID = o. Customer ID and OAid = (Select the top 1 ID from the order where the customer ID = CID order date DESC)   

For me, this is valid, but access keeps me throwing a syntax error. And when I hit okay, he chooses a piece of SQL text which is not related to it.

If I take an additional selection clause, but it works clearly

< P> You can not use it and the way in MS Access, along with where to replace it, you have two reserved words in your column (field) names - name, date should be attached to this table bracket when someone Table name or nickname is not predefined, or better , Its name should be changed.
  Select c.ID, c.Name, c.Address, o.ID, o date, o total value from customers. OOC on orders to join CNI Customer IDs where OID = (Order from top ID 1 where customer ID = CID order [date] by DESC)    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -