Saturday, February 25, 2012
newbie: value expression... uses an aggregate expression w/o a sco
issue..)
next thing, went to build the report in VS.NET and got 100 Build Errors
telling me that every TextBox on my summary page has the error:
'The value expression for the textbox '...' uses an aggregate expression
with a scope...'
Newbie (I know), but what on earth did I do that would have screwed up
everything like this?
( Scope for what? The report and parameters already have everything they
need as far as data goes.)
Rob(this is a frickin nightmare...)
So it looks like every time I try to add a new report parameter, after
deleting the original (simply the report parameter became a different report
item), about half of the textboxes which are sums and counts threw this error
(which is nutty as heck, since about 2/3, which have the same thing are OK).
Is this some kind of bug? (Deleted all Report Parameters and I can compile
w/o errors.)
What's going on with this and what does it take to 'set the scope'.
Rob
"RobKaratzas" wrote:
> simply added a report parameter for a working report (which went fine and w/o
> issue..)
> next thing, went to build the report in VS.NET and got 100 Build Errors
> telling me that every TextBox on my summary page has the error:
> 'The value expression for the textbox '...' uses an aggregate expression
> with a scope...'
> Newbie (I know), but what on earth did I do that would have screwed up
> everything like this?
> ( Scope for what? The report and parameters already have everything they
> need as far as data goes.)
> Rob
>
Monday, February 20, 2012
Newbie: how to make a datatypeconversion in a view
I'm making a view in SQL Server EM. In this view I want to generate a field
which combines 3 other fields simply together.
I have the fields: lngNumber (numeric), txtOpdrachtgever (string) and
txtAfdeling (string) which I want to combine (with a space between each
field). In Access reporting the string would be.
NameOutputField: lngNumber & " " & txtOpdrachtgever & " " & txtAfdeling
How does this work within SQL server. I get messages of datatype errors when
I use + or &. I don't now the syntaxis to convert fields.
So can anyone give a suggestion on how to make the above string and also
give a little bit information on the conversion of fields within views. I
didn't find it in the SQL help files.
Thanks,
Remco Groot beumer"Remco Groot Beumer" <nospam@.nospam.com> wrote in message
news:d6n28q$acb$1@.news1.zwoll1.ov.home.nl...
> Hello,
> I'm making a view in SQL Server EM. In this view I want to generate a
> field
> which combines 3 other fields simply together.
> I have the fields: lngNumber (numeric), txtOpdrachtgever (string) and
> txtAfdeling (string) which I want to combine (with a space between each
> field). In Access reporting the string would be.
> NameOutputField: lngNumber & " " & txtOpdrachtgever & " " & txtAfdeling
> How does this work within SQL server. I get messages of datatype errors
> when
> I use + or &. I don't now the syntaxis to convert fields.
> So can anyone give a suggestion on how to make the above string and also
> give a little bit information on the conversion of fields within views. I
> didn't find it in the SQL help files.
> Thanks,
> Remco Groot beumer
See CAST, CONVERT and "String Concatenation Operator" in Books Online - you
need to make sure everything is in a character data type when you
concatenate the string, eg.
create view dbo.MyView
as select 'Output: ' + cast(NumberColumn as char(10)) + ' ' + CharColumn
from dbo.MyTable
You might find it's easier to do this in your front end - presentation and
formatting are usually done there, and not in the database.
Simon|||Select convert(varchar(30),lngNumber) +' ' + txtOpdrachtgever +' ' +
txtAfdeling + ' ' from tbl
"Remco Groot Beumer" <nospam@.nospam.com> wrote in message
news:d6n28q$acb$1@.news1.zwoll1.ov.home.nl...
> Hello,
> I'm making a view in SQL Server EM. In this view I want to generate a
field
> which combines 3 other fields simply together.
> I have the fields: lngNumber (numeric), txtOpdrachtgever (string) and
> txtAfdeling (string) which I want to combine (with a space between each
> field). In Access reporting the string would be.
> NameOutputField: lngNumber & " " & txtOpdrachtgever & " " & txtAfdeling
> How does this work within SQL server. I get messages of datatype errors
when
> I use + or &. I don't now the syntaxis to convert fields.
> So can anyone give a suggestion on how to make the above string and also
> give a little bit information on the conversion of fields within views. I
> didn't find it in the SQL help files.
> Thanks,
> Remco Groot beumer