Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

SQL/OLEDB - Return MAX based on multiple criteria

Dears,

hope you can help me here with some SQL code on Query Editor. Connection is OLEDB.

I'd like to retrieve directly from source a clean set of data. This is, get lines with MAX date based on two criteria. See below my table.

For example, for "Order No_" = PC2116705 and "Order Line No_" = 10000, I'd need "Source ID" = LC2200174, since "Register Date" is the newer one.

 

Any clue on how to do it?

 

Thanks in advance,

 

1 Reply