【发布时间】:2013-04-18 05:02:26
【问题描述】:
我必须将 Cognos Impromptu 7 查询转换为 TSQL。部分查询包括以下内容:
nconvert((SUBSTRING((ascii(t1.TargetDate)) from 1 for 4)))
/*
where:
t1 is a table alias
TargetDate is a BIGINT contains the value 200501
*/
有人可以解释函数/表达式“ascii”的用途吗?
(仅供参考:SQL Server ASCII 函数产生 ascii(200501) ==> ascii(2) ==> 50 )
奖励:如果有人可以将我指向包含 ascii 定义的在线资源,我将不胜感激。我的搜索没有结果。
【问题讨论】:
-
我找到了这个 IBM developerWorks 资源,它表明 ASCII 函数执行与 TSQL ASCII 相同的任务。 ibm.com/developerworks/data/tutorials/db2-cert9188/…