Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get a record with the latest Date
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00448872
Message ID:
00448912
Views:
8
>In SQL Server, What would be my Statement to retreive a record with the latest date ?
>
>Someting Like This : Select * From MyTable Where Product = ?Parm1 And ???ChangedDate Is The Latest ???

Off the top of my head, without testing:
SELECT * 
   FROM myTable t1
   WHERE product = ?cParm1
   AND changedDate = 
      (SELECT product, MAX(changedDate)
          FROM myTable t2
          WHERE t1.product = t2.product
          GROUP BY product)
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Previous
Reply
Map
View

Click here to load this message in the networking platform