这是SQL语句:
select x_factory_date,actual_ship_date,edit from ship where edit='1' or edit='6'and
(datediff(dd,x_factory_date,actual_ship_date)>4)搜索到的数据
x_factory_date actual_ship_date edit
09/18/2009 2009-09-29 00:00:00.000 6
09/18/2009 2009-09-29 00:00:00.000 6
2009-12-03 00:00:00.000 6
11/17/2009 2009-11-19 00:00:00.000 1
12/25/2009 2009-12-26 00:00:00.000 1
07/15/2009 2010-03-17 00:00:00.000 6
08/27/2010 2010-09-10 00:00:00.000 6
08/19/2010 2010-11-10 00:00:00.000 1
03/31/2011 2011-04-03 00:00:00.000 1请问我哪里写错了, 11/17/2009 2009-11-19 00:00:00.000 1
12/25/2009 2009-12-26 00:00:00.000 1 这两条数据 不符合我后面一个时间的筛选条件啊,谁能帮我看看。
select x_factory_date,actual_ship_date,edit from ship where edit='1' or edit='6'and
(datediff(dd,x_factory_date,actual_ship_date)>4)搜索到的数据
x_factory_date actual_ship_date edit
09/18/2009 2009-09-29 00:00:00.000 6
09/18/2009 2009-09-29 00:00:00.000 6
2009-12-03 00:00:00.000 6
11/17/2009 2009-11-19 00:00:00.000 1
12/25/2009 2009-12-26 00:00:00.000 1
07/15/2009 2010-03-17 00:00:00.000 6
08/27/2010 2010-09-10 00:00:00.000 6
08/19/2010 2010-11-10 00:00:00.000 1
03/31/2011 2011-04-03 00:00:00.000 1请问我哪里写错了, 11/17/2009 2009-11-19 00:00:00.000 1
12/25/2009 2009-12-26 00:00:00.000 1 这两条数据 不符合我后面一个时间的筛选条件啊,谁能帮我看看。
你的语句等于
select x_factory_date,actual_ship_date,edit from ship where (edit='1') or (edit='6'and
datediff(dd,x_factory_date,actual_ship_date)>4)改成2/3楼即可