Basically, I am trying this in a table cell expression:
 =iif(patindex('%-%', Fields!courseName.Value) <>
 0,left(Fields!courseName.Value, patindex('%-%',
 Fields!courseName.Value)-1),Fields!courseName.Value)
 It errors because it says patindex is not declared. I tried doing this part
 in my query in a stored proc instead but was unable to get the results I
 needed, so thought I would try in RS instead.
 Is there any way for me to do this in RS? Basically in my stored proc I was
 trying to do:
 Query where patindex <> 0
 Union
 Query where patindex = 0
 The field I am trying to fix is basically: â'Name â' explanationâ' and all I
 want is the name before the â?...â'. But there are some fields with just â'Nameâ'
 and no dash or explanation. With my union statement, instead of getting:
 Name1
 Name2
 Name3
 I get
 Name1
 Name1 â' Explanation
 Name2
 Name2 - Explanation
 Name3
 Name3 â' Explanation
 The query I am using now gives me the results I want (correct records) and I
 am trying to split out the name in RS.
 Thank you for your time and help!WHen you are in an expression you are talking VB.NET...
Instr is the function you are looking for...
--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
I support the Professional Association for SQL Server ( PASS) and it''s
community of SQL Professionals.
"SharinDenver" wrote:
> Basically, I am trying this in a table cell expression:
> =iif(patindex('%-%', Fields!courseName.Value) <>
> 0,left(Fields!courseName.Value, patindex('%-%',
> Fields!courseName.Value)-1),Fields!courseName.Value)
> It errors because it says patindex is not declared. I tried doing this part
> in my query in a stored proc instead but was unable to get the results I
> needed, so thought I would try in RS instead.
> Is there any way for me to do this in RS? Basically in my stored proc I was
> trying to do:
> Query where patindex <> 0
> Union
> Query where patindex = 0
> The field I am trying to fix is basically: â'Name â' explanationâ' and all I
> want is the name before the â?...â'. But there are some fields with just â'Nameâ'
> and no dash or explanation. With my union statement, instead of getting:
> Name1
> Name2
> Name3
> I get
> Name1
> Name1 â' Explanation
> Name2
> Name2 - Explanation
> Name3
> Name3 â' Explanation
> The query I am using now gives me the results I want (correct records) and I
> am trying to split out the name in RS.
> Thank you for your time and help!
>
 
No comments:
Post a Comment