query from recent status date?

  • How can i get query from recent or closer or the last time it get updated?

    what can be done?

    Thanks

    Pat

  • Can you rephrase that???

    What information is available, what information do you need to extract??

  • i have multiple data that represent same key (item) and it has status date along with it so how can i get the latest update that made on that key or item. the status_date colume is datetime type.

    Thanks

  • select item, max(StatusDate)

    from table

    Group By Item

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Can't really help you without the table definition and required output...

    Select * from dbo.YourTable Y inner join

    (Select key1, key2, max(date) as date from dbo.YourTable group by key1, key2) dtY

    on Y.key1 = dtY.key1 and Y.key2 = dty.Key2 and Y.date = dty.date

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply