Showing posts with label combines. Show all posts
Showing posts with label combines. Show all posts

Sunday, March 25, 2012

Combining established columns into one

I have a table whose schema is already defined and populated with data. I would like to create a column named Name that combines the first and last name columns in the following format "last name, first name". I tried to create a formula that concatenated these two columns, but it kept spitting up on me. Any ideas?Could you please post your syntax?|||It is best to do the formatting for display purposes on the client. What if you want to change the formatting later? You hav e to make schema changes even if you use computed columns or views or queries in SPs.|||

you may wish to use a calculated column

use northwind
select * from employees
go
alter table employees
add
fullname as rtrim(lastname)+','+rtrim(firstname)
go

select fullname,lastname,firstname from employees

|||I realize that it would be best to do all the formatting on the client. The problem is that I have about 50 stored procedures that were developed on another database that was "supposed to" have the same table schemas. Unfortunately, the developer decided to split apart the names into first name and last name fields. It would be easier to just created a computed column.|||Actually, splitting the name into it's constituent parts and storing it is the correct way. You can use a computed column or view with the computed expression or modify your SP to include the computed expression. With all these methods, you can get the required column for display purposes. But if you want to search on this concatenated string then it is a different deal. Performance depends on lot of factors like index on the computed column, whether optimizer matches the computed column expression and uses the index and so on.

Thursday, March 22, 2012

Combining a Stacked column and continous line graph

Hi All
I am trying a build a RS report which as a graph which combines two
series in to a stacked column and the remaining 6 data series as
continous line graphs.
I sort of managed to get it but it never works when compared to the
corresponding Excel graph.
Please help how do I build a graph report with combination of stacked
column and continous line graphs.
Thanks
KarenYou can combine a column and a line chart. Just set the chart type to column
and look for the "Plot data as line" checkbox on the data value appearance
tab. You may also be interested in this "how to" article:
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B842422
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
<karenmiddleol@.yahoo.com> wrote in message
news:1131153902.660326.3140@.g44g2000cwa.googlegroups.com...
> Hi All
> I am trying a build a RS report which as a graph which combines two
> series in to a stacked column and the remaining 6 data series as
> continous line graphs.
>
> I sort of managed to get it but it never works when compared to the
> corresponding Excel graph.
>
> Please help how do I build a graph report with combination of stacked
> column and continous line graphs.
> Thanks
> Karen
>