Hello,
I have a problem with importing data from ms access to excel with <acronym title="visual basic for applications">VBA</acronym>. I use "ADO Connection" to connect excel with acces.
I have 2 tables in ms access. I want to get the newest comment from table p_comment for products. I tried it with inner join, but i get all comments.
so how can i get only the newest/latest comment for a product?
thank you for your help.
sql= "SELECT p_comment.ID, p_comment.p_id, p_comment.user, p_comment.comment, p_comment.c_date FROM product INNER JOIN p_comment ON product.ID = p_comment.p_id"
p_comment
<tbody>
</tbody>
product:
<tbody>
</tbody>
I have a problem with importing data from ms access to excel with <acronym title="visual basic for applications">VBA</acronym>. I use "ADO Connection" to connect excel with acces.
I have 2 tables in ms access. I want to get the newest comment from table p_comment for products. I tried it with inner join, but i get all comments.
so how can i get only the newest/latest comment for a product?
thank you for your help.
sql= "SELECT p_comment.ID, p_comment.p_id, p_comment.user, p_comment.comment, p_comment.c_date FROM product INNER JOIN p_comment ON product.ID = p_comment.p_id"
p_comment
ID | p_id | user | comment | c_date |
1 | 1 | test user | test comment | 19.02.2017 |
2 | 1 | test123 | comment1 | 19.02.2017 |
3 | 2 | test1 | comment3 | 19.02.2017 |
4 | 2 | test1234 | commen4 | 19.02.2017 |
<tbody>
</tbody>
product:
ID | p_name | p_date | p_desc |
1 | test | 01.02.2017 | test |
2 | hallo | 01.02.2017 | test |
<tbody>
</tbody>