Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Get Last Record of same ColumnID

$
0
0

i am currently stuck on the following Task:

i have a table that Looks similiar to this one

| TableID | EntityID | InvoiceAmount|      Date      |
|     1      |  46       | 300000         |14-01-2014|
|     2     |  232      | 2456,63          |17-01-2014|
|     3      |  46       | 400000          |22-01-2014|
|     4      | 232      | 333000         |31-01-2014|
|     5      |  12       | 124                |11-01-2014|
|     6      |  46       | 300000         |31-01-2014|

What i Need is the last Invoice amount by EntityID according to the Date Column, so in the Case of EntityID 46 this would be the 31-01-2014, and the Value of the Entity would be: 300 000.

Question: Is there a way to do this in SQL or what other Option do i have ?

thanks a lot in Advance!


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>