简体   繁体   English

使用= First函数的SSRS(SQL Server 2008 R2)报表生成器

[英]SSRS (SQL Server 2008 R2) Report Builder Using =First function

I am writing a simple report in SQL Server 2008 R2 Report Builder (SSRS). 我正在SQL Server 2008 R2报表生成器(SSRS)中编写一个简单的报表。

I want to get a phone number using this expression: 我想使用以下表达式获取电话号码:

=First(Fields!PHONE1.Value, "TWO")

and it is returning the exact phone number (no error). 并返回确切的电话号码(无错误)。 Phone number length is 14 characters, but I wanted to get only first 10 digits/characters. 电话号码长度为14个字符,但我只想获取前10位数字/字符。

How can I do that? 我怎样才能做到这一点?

Try this: 尝试这个:

=LEFT(First(Fields!PHONE1.Value, "TWO"),10)

Let me know if this helps you. 让我知道这是否对您有帮助。

我会在我的SQL查询中SELECT left([PHONE1],10)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM