According to definition: 
**The LAST\_VALUE() function is a window function that returns the last value in an ordered partition of a result set.**

So in my example I need to grab the last ExpirationDate date based on QuoteID. 

Using `FIRST_VALUE()` ordered by `QuoteID DESC` produces correct result. 

So I am expecting using `LAST_VALUE()` ordered by `QuoteID ASC` should producer the same result. 

However it gives me incorrect result.

Am I missing something?

```
  DECLARE @Table TABLE ( QuoteID int, PolicyNumber varchar(100), ExpirationDate date)
 INSERT INTO @Table
 (
     QuoteID,
     PolicyNumber,
     ExpirationDate
 )
 VALUES
 (
     1, -- QuoteID - int
     'Pol1', -- PolicyNumber - varchar
     '2019-05-01' -- ExpirationDate - date
 ),
  (
     2, -- QuoteID - int
     'Pol1', -- PolicyNumber - varchar
     '2018-05-01' -- ExpirationDate - date
 )

 SELECT QuoteID, [@Table].ExpirationDate    ,[@Table].PolicyNumber
    ,CAST(FIRST_VALUE(ExpirationDate) OVER (PARTITION BY PolicyNumber ORDER BY QuoteID DESC) AS DATE) as FIRST_VALUE_ExpirationDate --Correct
    ,CAST(LAST_VALUE(ExpirationDate) OVER (PARTITION BY PolicyNumber ORDER BY QuoteID ) AS DATE) as LAST_VALUE_ExpirationDate --Gives Incorrect 
 FROM @Table 
 ORDER BY QuoteID

```

[![enter image description here](https://i.stack.imgur.com/899y0.png)](https://i.stack.imgur.com/899y0.png)