+ -
当前位置:首页 → 问答吧 → SQL Server中的语句到Access中为什么运行不了,语句有哪些不同

SQL Server中的语句到Access中为什么运行不了,语句有哪些不同

时间:2011-05-25

来源:互联网

SQL Server 中的语句如下: 在SQL Server management studio内运行正常,但在Access内不能运行,请问语句有哪些差别呀?谢谢!

select *,

(select count(1) from all_abc  
where ci=a.ci  
and cast(TCH掉话率 as float)!=0  
and day(cast(测量时间 as datetime)) in ('24')) as 本日掉话时段数

from

(select
top 30
城市,
测量时间,
小区名,
ci,
载频数,
TCH配置数,
TCH可用率=round(cast(TCH可用数 as float)/cast(TCH配置数 as float),2),
case cast(TCH可用数 as float) when 0 then null else round(cast(TCH话务量 as float)/cast(TCH可用数 as float),2) end as 每信道话务量,
本日最大TCH掉话率=TCH掉话率,
TCH掉话次数
from all_abc
where cast(TCH掉话率 as float)!=0
and round(cast(TCH话务量 as float)/cast(TCH可用数 as float),2)>0.1
and TCH掉话次数>10
and 城市='阿勒泰'
and day(cast(测量时间 as datetime))='24'
--and 测量时间 between '2011/5/22 8:00:00' and '2011/5/22 10:00:00' 为什么错误,不能执行?
group by 城市,测量时间,小区名,ci,载频数,TCH配置数,TCH可用数,TCH话务量,TCH掉话率,TCH掉话次数
order by 本日最大TCH掉话率 desc)a

where not exists (select * from all_abc where 小区名=a.小区名 and TCH掉话率>a.本日最大TCH掉话率)
order by 本日最大TCH掉话率 desc


到Access中运行不了

提示语法错误:这一句
(select count(1) from all_abc  
where ci=a.ci  
and cast(TCH掉话率 as float)!=0  
and day(cast(测量时间 as datetime)) in ('24')) as 本日掉话时段数

估计后面还有语法错误

作者: laddie10   发布时间: 2011-05-25

Access 不支持Cast

作者: marco   发布时间: 2011-05-25