可以先用
select count(date) into 变量名 from 表名 where date ='2009-4-13'
取date为'2009-4-13'的记录行数,如果为0则用insert语句,如果大于0,则用update语句
只用一条sql语句是出不来的
call openconn
sql="select * from 二维表 where date='2009-4-13'"
rs.open,sql,cn.3,3
if rs.recordcount>0
then goto update
if rs.eof then goto addnew
update:
rs!date=2009-4-13
rs!amount=50
rs.update
call closeconn
addnew:
rs.addnew
rs!date=2009-4-13
rs!amount=50
rs.update
call closeconn
VB 可行~~~