急急急!!!我写的sql语句不知道哪错了!!

[复制链接]
查看11 | 回复3 | 2012-6-21 10:41:48 | 显示全部楼层 |阅读模式
你的条件语句有问题:if (select count(*) from yaopin where (year(截止日期)-year(getdate()))1)...
回复

使用道具 举报

千问 | 2012-6-21 10:41:48 | 显示全部楼层
if (select count(*) from yaopin where (year(截止日期)-year(getdate()))<1)改成if (select count(*) from yaopin where (year(截止日期)-year(getdate())<1))...
回复

使用道具 举报

千问 | 2012-6-21 10:41:48 | 显示全部楼层
print cast(@药品编号 as varchar(10))+'药品即将过期'...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行