ssrs 表达式可以分割字符串吗?
所以在我的查询中,我有 select columnx from tblz
它返回 001.255556.84546
我希望能够通过“.”来分割它并将其分成三列。
column1 = 001
column2 = 255556
column3 = 84576
这可能吗?
so in my query i have select columnx from tblz
it returns 001.255556.84546
I want to be able to split this via '.' and put it into three columns.
column1 = 001
column2 = 255556
column3 = 84576
is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
仅供参考,在 2008 年这些不起作用,您必须执行以下操作:
For info, in 2008 these dont work, you have to do the following:
使用以下表达式创建三个计算字段:
我不确定它是否有效,也许可以尝试一下。您可能需要在获取值之前使用 IIF() 语句来检查值。
Create three calculated fields with the following expressions:
I'm not sure it works or not, maybe give it a try. You might need to use IIF() statement to check values before getting them.
在 SSRS 中,您引用字段名称,告诉它要使用的分隔符。由于您本身没有分配给变量,因此您需要告诉它要使用分割字符串的哪一部分。在您的示例中,
您可以将 returnedValue 替换为实际字段名称,并将其中每一者分别放入您的第 1 - 3 列中。
In SSRS you reference the field name, tell it the delimiter to use. Since you are not assigning to a variable, per se, you then need to tell it which part of the split string to use. In your example
You would replace returnedValue with whatever the actual field name is, and place each one of those into your columns 1 - 3, respectively.
该答案最初发布在问题中,而不是作为答案发布:
This answer was originally posted in the question instead of being posted as an answer: