注册 登录
编程论坛 Oracle论坛

求助---sql 报表转换为 oracle 报表!!!!

求索者 发布于 2014-07-24 20:08, 1256 次点击
select case  
when substring(convert(varchar,getDate(),120),6,14) >= '[?FristSeasonStart|01-01 00:00:00?]'  
and substring(convert(varchar,getDate(),120),6,14) < '[?FristSeasonEnd|03-25 23:59:59?]'
then 1  
when substring(convert(varchar,getDate(),120),6,14) >= '[?SecondSeasonStart|03-26 00:00:00?]'  
and substring(convert(varchar,getDate(),120),6,14) < '[?SecondSeasonEnd|06-25 23:59:59?]'
then 2  
when substring(convert(varchar,getDate(),120),6,14) >= '[?ThirdSeasonStart|06-26 00:00:00?]'  
and substring(convert(varchar,getDate(),120),6,14) < '[?ThirdSeasonEnd|09-25 23:59:59?]'
then 3  
when substring(convert(varchar,getDate(),120),6,14) >= '[?FourthSeasonStart|09-26 00:00:00?]'  
and substring(convert(varchar,getDate(),120),6,14) < '[?FourthSeasonEnd|12-31 23:59:59?]'
then 4  
else '0' end as quarter
0 回复
1