Delphi里数据类型转换问题

来源:百度知道 编辑:UC知道 时间:2024/09/22 18:22:31
update Storage set StorageNum=StorageNum-'+'''' self.EdtNum.Text +'''' +' where TypeID=' + ''''+ self.EdtID.Text +'''' +'and SrugBatch=' + ''''+ self.EdtBatch.Text +''''

这个是Delphi里用来更新数据库内容的语句,怎么把self.EdtNum.Text 那块改变下,转化数据类型?

你把下面这面代码拷进行就OK了!
我的理解前提:
storageNum(string)= 'storageNum-N'(N (int))
typeID(int)
srugbatch(int)

'update Storage set StorageNum=StorageNum-'+self.EdtNum.Text+' where TypeID= ' +self.EdtID.Text +' and SrugBatch= ' +self.EdtBatch.Text

数值型不需要加俩单引号,字符型和日期型需要加俩单引号
'set StorageNum=StorageNum-'+self.EdtNum.Text+' where '