在程序中写SQL语句 select max(code) from table10 where ...
code是 sql server里的 varchar 类型(是纯数字但位数太长 故用字符型)
怎么取max的返回值
var iCount :integer
iCount:=Adoquery1.field[0].asinteger 为何不行?(类型不配?)
该怎么取?????
如果没有符合的条件的记录
用
if *..recordcount = 0 then
icount;=0
又为什么不被执行?
code是 sql server里的 varchar 类型(是纯数字但位数太长 故用字符型)
怎么取max的返回值
var iCount :integer
iCount:=Adoquery1.field[0].asinteger 为何不行?(类型不配?)
该怎么取?????
如果没有符合的条件的记录
用
if *..recordcount = 0 then
icount;=0
又为什么不被执行?
iCount:=AdoQuery1.FieldByName('最大值 ').AsInteger;
试试select max(code) from table10 where ...
var iCount :string
iCount:=Adoquery1.field[0].asstring
if not(ADOQuery.IsEmpty) then
iCount:=AdoQuery1.FieldByName('maxcode').AsInteger;
showmessage(AdoQuery1.fields.field[0].asstring);
来看看返回的字符串值是什么。