Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Vack
Aged Yak Warrior
530 Posts |
Posted - 2012-03-14 : 15:06:02
|
I want a select statment that will grab the old_qty that has the oldest(min) date. When I do my select statement I would like it to grab 34 for the old qty. Table name: iminvtrxselect (case when min(trx_dt) then old_qty end)from iminvtrx ??????Trx_dt old_qty 01/01/2004 3402/02/2005 23 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-03-14 : 15:25:43
|
| [code]SELECT TOP (1) Trx_dt,old_qtyFROM iminvtrxORDER BY Trx_dt[/code] |
 |
|
|
|
|
|