ENV:Cognos 8
尝试将Cognos Query转换为SQL Server,并尝试找到与cognos Cdate等效的SQL函数。
在cognos中查询是
select (**cdate(T1."activity_dt_key"**)) as c1,
(reverse(truncate(reverse(T1."emp_opunit")))) || T1."emp_id" as c2,
CASE WHEN (T1."job_approval_fg" = '1') THEN ('Approved') ELSE ('Not Approved') END as c3,
T1."emp_opunit" as c4,
T1."emp_id" as c5,
T1."entered_bac_code" as c6,
T1."job_number" as c7,
T1."normal_hrs" as c8,
T1."ot_hrs" as c9,
(T1."normal_hrs" + T1."ot_hrs") as c10,
CASE WHEN (T1."activity_count" IS NULL) THEN (0) ELSE (T1."activity_count") END as c12,
CASE WHEN ((T2."pay_period_hrs" IS NULL) or (T2."pay_period_hrs" = 0)) THEN (0) ELSE (T2."base_pay" / T2."pay_period_hrs") END as c13,
CASE WHEN ((T2."pay_period_hrs" IS NULL) or (T2."pay_period_hrs" = 0)) THEN (0) ELSE (T2."allowance" / T2."pay_period_hrs") END as c14,
(extract(DAY FROM (now()) - ((cdate(T1."activity_dt_key"))))) as c15
from ("ts_activity" T1 left outer join "es_emps_pay_hist" T2 on (T1."emp_id" = T2."emp_id") and (T1."activity_dt_key" BETWEEN T2."from_date" AND T2."to_date"))
where (((extract(DAY FROM (now()) - ((**cdate(T1."activity_dt_key"**)))))) <= 547)
order by c1 desc
在Cognos文档中找不到对该功能的任何引用。