April 25, 2012 at 9:35 am
hi,
i am using replace function.
giving me error like 'Error converting data type nvarchar to float'
reportheading1 is nvarchar(72)
select ReportHeading1 From vPortfolioBase
Where PortfolioBaseCode = Replace(@Portfolios,'@','') as reportheading1
any help?
April 25, 2012 at 9:38 am
Either column "PortfolioBaseCode" is datatype Float, or variable "@Portfolios" is. Can't tell which one from your post, but it's one or both.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 9:40 am
they both are nvarchar
April 25, 2012 at 9:42 am
Then the error is somewhere else in your code. Post the right part.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 9:47 am
nope.if i remove this line,it works fine
April 25, 2012 at 9:49 am
GSquared (4/25/2012)
Then the error is somewhere else in your code. Post the right part.
Gus, walk away. You will never get a full answer to any of your questions.
April 25, 2012 at 9:52 am
Then there's something else wrong.
If you're getting that error message, some piece of your query is trying to convert a string (NVarchar) to a floating point value, and it's incompatible. You don't get that error unless that's what's going on.
Is that the whole query? Or is it part of something else?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 9:52 am
These errors are conversion errors. Somewhere your data contains a value that is not compatible with the float type.
I don't see anything in that code that would cause it, so I suspect you are missing something else in the code.
April 25, 2012 at 9:53 am
Lynn Pettis (4/25/2012)
GSquared (4/25/2012)
Then the error is somewhere else in your code. Post the right part.Gus, walk away. You will never get a full answer to any of your questions.
I know. Not worried about it.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 9:54 am
Does anyone see anything wrong with this where clause?
Where PortfolioBaseCode = Replace(@Portfolios,'@','') as reportheading1
April 25, 2012 at 10:02 am
Lynn Pettis (4/25/2012)
Does anyone see anything wrong with this where clause?
Where PortfolioBaseCode = Replace(@Portfolios,'@','') as reportheading1
"as" then column alias in a Where clause.
Which won't parse.
Which means it's not the actual code (since it would get a different error).
Which means the error is coming from something other than what was posted.
Which means ...
That's why I'm not bothering asking for the code. Just pointing out that the problem is caused by a conversion error and how to look for one.
You may note I'm telling him what's wrong, not asking him to clarify. I know that won't happen, from his posting history. Either he'll work with what I post, or he won't. Not my problem either way. His problem to deal with.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 10:06 am
GSquared (4/25/2012)
Lynn Pettis (4/25/2012)
Does anyone see anything wrong with this where clause?
Where PortfolioBaseCode = Replace(@Portfolios,'@','') as reportheading1
"as" then column alias in a Where clause.
Which won't parse.
Which means it's not the actual code (since it would get a different error).
Which means the error is coming from something other than what was posted.
Which means ...
That's why I'm not bothering asking for the code. Just pointing out that the problem is caused by a conversion error and how to look for one.
You may note I'm telling him what's wrong, not asking him to clarify. I know that won't happen, from his posting history. Either he'll work with what I post, or he won't. Not my problem either way. His problem to deal with.
But he also said
riya_dave (4/25/2012)
nope.if i remove this line,it works fine
So, if he takes out this code:
select ReportHeading1 From vPortfolioBase
Where PortfolioBaseCode = Replace(@Portfolios,'@','') as reportheading1
No error.
April 25, 2012 at 10:10 am
thanks guys,got the answer,
April 25, 2012 at 11:59 am
anybody here ssrs expert??????????
April 25, 2012 at 1:14 pm
riya_dave (4/25/2012)
anybody here ssrs expert??????????
im sure there are some and if you post in the SSRS section of the boards and post all the information we request you may get better results.
For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]
Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
Jeff Moden's Cross tab and Pivots Part 1[/url]
Jeff Moden's Cross tab and Pivots Part 2[/url]
Viewing 15 posts - 1 through 15 (of 23 total)
You must be logged in to reply to this topic. Login to reply