【问题标题】:How to reverse the Lastname,Firstname of an expression inside a Cognos data item?如何反转 Cognos 数据项中表达式的姓氏、名字?
【发布时间】:2017-08-25 00:49:08
【问题描述】:

我在 Cognos 中创建了一个列表报告,LAST NAME 列当前是 Lastname,Firstname 的顺序,除了 Firstname 之外没有空格,包括第二个名字。

从当前的设置中

    LAST_NAME COLUMN
    Morello,Mortel     
    Chopra,Deepak      
    Fothergill,Mike Edward   
    Smith,David        

我希望得到这个结果。

    NEW DATA ITEM
    Mortel Morello
    Deepak Chopra
    Mike Edward Fothergill
    David Smith

我尝试使用子字符串函数,但它不起作用。

substring(LAST_NAME, position(',', LAST_NAME)+1, 
inStr(LAST_NAME, ' ',position(',', LAST_NAME)+1, 1))

【问题讨论】:

    标签: oracle11g cognos-10


    【解决方案1】:

    这应该可行:

    substring([Last Name],position(',',[Last Name])+1) 
    + ' ' +
    substring([Last Name],1,position(',',[Last Name])-1)
    

    【讨论】:

    • 当我在查看表格数据中运行查询时,您的答案运行得更快。谢谢!!
    猜你喜欢
    • 2021-09-03
    • 2014-10-07
    • 2016-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多