1个回答
展开全部
dim persn_cnt as long
persn_cnt = dcount("id","person_table","[dept]='office' and [month_salary]>10000")
if persn_cnt < 0 then
msgbox"没有这样的员工",,"系统提示"
end if
persn_cnt = dcount("id","person_table","[dept]='office' and [month_salary]>10000")
if persn_cnt < 0 then
msgbox"没有这样的员工",,"系统提示"
end if
追问
哦,不管怎么样还是谢谢你吧,但你给我的这段代码我 实在是没看懂,我说的sql语句是
select 字段名称 from 表格名称
我指的是这种的
追答
执行SQL语句 计算一段时间内数据的方差值:
Dim conn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim cmd As New ADODB.Command
conn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;" & "User ID=sa;PassWord=你数据库密码;Initial Catalog=数据库名"
conn.Open
cmd.ActiveConnection = conn '使用命令对象方法
cmd.CommandText = "select VAR(b02a_atp1_ia) as b02a_atp1_ia
from dbo.B02A_ATP1
where [time] between ('2008-10-10 9:16:52') And ('2008-10-10 9:56:52')"
Set rst = cmd.Execute
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询