Z
zhouwenlin_1
Unregistered / Unconfirmed
GUEST, unregistred user!
表aa中有2个列,Caigoudanid和nowdate 分别代表采购单号和当前日期<br><br>YKCG08072301~~~YKCG08072318<br><br>select max(right(rtrim(Caigoudanid),2)) as i2 from aa //得到尾数最大的采购单<br><br>i2:=ADOQuery1.FieldByName('i2').AsInteger;<br><br>i2=18<br><br>但我还想得到尾数最大的采购单的尾数和它对应的日期<br><br>应该怎样写SQL语句啊???<br><br>先谢谢了啊