我的SQL语句是这样写的:
select * from regholiday
where Empid='600052' and
convert(varchar,starttime,101)='07/17/2006' and
((StartTime>='2006-7-17 9:44:00' and EndTime>='2006-7-17 9:44:00') or
(StartTime<='2006-7-17 9:44:00' and EndTime>='2006-7-17 9:44:00') or
(StartTime<='2006-7-17 9:44:00' and EndTime<='2006-7-17 9:44:00'))
如果我想使用过滤的方法,过滤条件如何写:
查询语句为:select *,convert(varchar,starttime,101) as TempDate from regholiday下面的写法过滤是错误的:
AdoDataSet.Filter:=Empid='600052' and TempDate='07/17/2006' and
((StartTime>='2006-7-17 9:44:00' and EndTime>='2006-7-17 9:44:00') or
(StartTime<='2006-7-17 9:44:00' and EndTime>='2006-7-17 9:44:00') or
(StartTime<='2006-7-17 9:44:00' and EndTime<='2006-7-17 9:44:00'))
select * from regholiday
where Empid='600052' and
convert(varchar,starttime,101)='07/17/2006' and
((StartTime>='2006-7-17 9:44:00' and EndTime>='2006-7-17 9:44:00') or
(StartTime<='2006-7-17 9:44:00' and EndTime>='2006-7-17 9:44:00') or
(StartTime<='2006-7-17 9:44:00' and EndTime<='2006-7-17 9:44:00'))
如果我想使用过滤的方法,过滤条件如何写:
查询语句为:select *,convert(varchar,starttime,101) as TempDate from regholiday下面的写法过滤是错误的:
AdoDataSet.Filter:=Empid='600052' and TempDate='07/17/2006' and
((StartTime>='2006-7-17 9:44:00' and EndTime>='2006-7-17 9:44:00') or
(StartTime<='2006-7-17 9:44:00' and EndTime>='2006-7-17 9:44:00') or
(StartTime<='2006-7-17 9:44:00' and EndTime<='2006-7-17 9:44:00'))
AdoDataSet.Filter:='Empid=''600052'' and TempDate=''07/17/2006'' and
((StartTime>=''2006-7-17 9:44:00'' and EndTime>=''2006-7-17 9:44:00'') or
(StartTime<=''2006-7-17 9:44:00'' and EndTime>=''2006-7-17 9:44:00'') or
(StartTime<=''2006-7-17 9:44:00'' and EndTime<=''2006-7-17 9:44:00''))';
AdoDataSet.Filtered:=true;例如:cdstemp.filter:='BK_TYPE='+''''+GCalltype+''' and type=''A''';
dephi不支持嵌套过滤吗?(条件)and (条件 or 条件 )这条的形式吗?
即A(B+C(D+E)),
不要告诉我要分解成:AB+ACD+ACE形式