已知现在是2009年8月10日,下面是表m:
产品编号 安装时间 保质期(年)
1 2006-01-01 2
2 2006-08-08 3
3 2007-09-09 4各位:怎么求过了保质期的产品编号????sql语句怎么写啊??!!!!!
产品编号 安装时间 保质期(年)
1 2006-01-01 2
2 2006-08-08 3
3 2007-09-09 4各位:怎么求过了保质期的产品编号????sql语句怎么写啊??!!!!!
SQL Server求年数差的函数DATEDIFF
已知现在是2009年8月10日,下面是表m:
产品编号 安装时间 过保时间
1 2006-01-01 2008-01-01
2 2006-08-08 2009-08-08
3 2007-09-09 2011-09-09 各位:怎么求过了保质期的产品编号????sql语句怎么写啊??!!!!!
产品编号 安装时间 过保时间
1 2006-01-01 2008-01-01
2 2006-08-08 2009-08-08
3 2007-09-09 2011-09-09 各位:怎么求过了保质期的产品编号????sql语句怎么写啊??!!!!!
where getdate() > DATEADD(year,保质期(年) ,安装时间 )
已知系统时间是2009年8月10日,下面是表m:
产品编号 安装时间 过保时间
1 2006-01-01 2008-01-01
2 2006-08-08 2009-08-08
3 2007-09-09 2011-09-09 各位:怎么求过了保质期的产品编号????sql语句怎么写啊??!!!!!
产品编号 安装时间 过保时间
1 2006-01-01 2008-01-01
2 2006-08-08 2009-08-08
3 2007-09-09 2011-09-09 各位:怎么求过了保质期的[color=#008000]产品编号????sql语句怎么写啊??!!!!! [/color]
where getdate() > DATEADD(year,保质期(年) ,安装时间 ) 或者select * from table
where 保质期(年)〈 DATEDIFF(year, 安装时间,getdate())
产品编号 安装时间 过保时间 (old) 是否过期(flag)
1 2006-01-01 2
2 2006-08-08 3
3 2007-09-09 4update m set flag = "y" where DateAdd(yyyy, old,getdate()) > getdate()
我刚才理解的 请高手说下对不对 谢谢
create table #T
(
id int,
indate datetime,
Saveyear int
)
insert into #T
select 1,'2006-01-01',2
union select 2,'2006-08-08',3
union select 3,'2007-09-09',4 select id from #T
where dateadd(year,Saveyear,indate)<getdate()drop table #T
点击button之后怎么让dataGridView控件变为自己设定的尺寸????????
我写的是错的" private void button1_Click(object sender, EventArgs e)
{
groupBox1.Visible = true;
dataGridView1.Size = System.Drawing.Size(650, 317);
}
点击button之后怎么让dataGridView控件变为自己设定的尺寸????????
我写的是错的" private void button1_Click(object sender, EventArgs e)
{
groupBox1.Visible = true;
dataGridView1.Size = System.Drawing.Size(650, 317);
}
产品编号 安装时间 过保时间
1 2006-01-01 2008-01-01
2 2006-08-08 2009-08-08
3 2007-09-09 2011-09-09 各位:怎么求过了保质期的[color=#008000]产品编号????
SELECT * FROM TEST WHERE GETDATE()<D2 AND FLAG='N' D2是日期类型的