Showing posts with label chart. Show all posts
Showing posts with label chart. Show all posts

Monday, March 26, 2012

is it possible to grab data from 2 different databases

Hello-

I have a chart I am producing in .net and I need to values. The problem is the values (sums) i need are on 2 different servers. Is there any where to combine the query using two databases? Does anyone have any suggestions?

thanksYou may try to use something like:

"SELECT a.*, b.* FROM DB1..TableA a INNER JOIN DB2..TableB b ON a.WhatID = b.WhatID"

Regards,|||but they are on two different servers.. How would I set up the connection string for that?|||With that scanerio, what I have done is issued a sp_addlinkedserver from SERVER1 to link to SERVER2. Then you can access SERVER2 through SERVER1 by using a fully qualified table name: SELECT * FROM Server2.Database2.dbo.Table1.

Terri|||what is a sp_addlinkedserver and how do i set this up?

thanks|||Looks like we straightened this out in another thread:view post 458481

Terrisql

Monday, March 19, 2012

Is it possible to chart values contained within a single field?

Just picking up SRS for the first time, so please excuse me if my question turns out to be dumb. If I have a Field that contains a csv (comma seperated variable) list of integers, is there any way to chart those values within a report?

I.e:

SELECT id, value FROM DataTable WHERE id = @.ValueId

id value

-- --

1 1,2,3,4,5,6,7,8,9,10,11

(1 row(s) affected)

I can do something like =split(Fields!Value.Value, ",") to get the individual data points out, but I'm not sure how to create a data set out of them so that I can point the chart to it. Changing the DB schema to accomidate the report is kinda out of the question at this point.

Thanks!

You could rewrite your query to split "Value" into numbers and group it by "ID", something like this:

1, ‘1,2,3,4’

2, ‘1,1,2’

1, 1

1,2

1,3

1,4

2,1

2,1

2,2

You can use split() but I don't think you can use it in the chart. It won't acceppt string[] as a value.