sql query help

zolf
zolf used Ask the Experts™
on

Hello there,

i have a table which had a createddate and updateddate col. now i want to query this table to return the last date a product was update.how can i get it.

cheers
zolf
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:

please help
Commented:
Hi Zolf,
          I think, this can help u.
Select [Product Code], Max(updateddate) from table1 Group By [Product Code]
Qlemo"Batchelor", Developer and EE Topic Advisor
Top Expert 2015
Commented:
If you want to know only a particular product, you can simplify that by using
   select max(updateddate) from table1 where product = 'Your Product'
11/26 Forrester Webinar: Savings for Enterprise

How can your organization benefit from savings just by replacing your legacy backup solutions with Acronis' #CyberProtection? Join Forrester's Joe Branca and Ryan Davis from Acronis live as they explain how you can too.

Vitor MontalvãoIT Engineer
Distinguished Expert 2017

Commented:
Strange. How that table works? There is a record for each time the product was updated? Or update date only stores the first/last update?

Author

Commented:

>>There is a record for each time the product was updated?
no,the updatedDate col is edited everytime the product is edited

Author

Commented:
thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial