October 3, 2014 at 10:17 am
I have a report that uses three tables from a database. As long as I only use two of the tables, it runs fine. I need the data from the third table for a line chart. So of course there is a great deal of data in the third table. I have a where clause for start date and end date. Is there a way I could only search the third table after I know what I need from it? Or does someone have a better solution to this problem?
October 3, 2014 at 10:28 am
Do you have any DDL/Sample data for the three tables in question?
Can you post the query plan for the ad-hoc SQL or Stored proc that drives this report?
-- Itzik Ben-Gan 2001
October 3, 2014 at 10:37 am
Here is the query:
/code
SELECT HeatData.HEAT_IDX, HeatData.HEAT_NUMBER, HeatData.FURNACE_IDX, HeatData.TURN_DATE, HeatData.POUR_START_TIME, HeatData.POUR_DURATION,
MovementAlarms.HEAT_IDX AS Expr1, MovementAlarms.ALARM_DURATION, ChartData.HEAT_IDX AS Expr2, ChartData.SAMPLE_TIME,
ChartData.FURNACE_ANGLE
FROM HeatData INNER JOIN
MovementAlarms ON HeatData.HEAT_IDX = MovementAlarms.HEAT_IDX INNER JOIN
ChartData ON MovementAlarms.HEAT_IDX = ChartData.HEAT_IDX
/code
I will work on getting the data sample.
Thank You for any help.
October 3, 2014 at 10:49 am
Data Sample
Heat Data Table
( HeatIdx, int, not null
HeatNumber, varchar(10), null
FurnaceIdx, int, null
TurnDate, datetime,null
PourStartTime, datetime, null
PourDuration, varchar(10), null
)
Movement Alarm Table
(HeatIdx, int, not null
AlarmStartTime, datetime, null
AlarmDuration, float, null
)
Chart Data Table
(HeatIdx, int, not null
SampleTime, datetime, null
FurnaceAngle, float, null
)
I hope this is what you are requesting. I am new to forums.
October 3, 2014 at 11:46 am
What I was hoping for is a way to search the Heat Data and Movement Alarm tables first. That would tell me which Chart Data information I would need. I only have to produce line charts for heats with a percentage of 15 and higher, which is determined using the Heat Data and Movement Alarm tables.
October 3, 2014 at 2:20 pm
I found the solution. In case anyone else has this problem go to http://support2.microsoft.com/kb/115237.
October 3, 2014 at 2:36 pm
mballentine (10/3/2014)
Thanks for posting that ddl and other info. Sorry I did not reply sooner; if not for the fact that I'm flying back home I would have replied sooner. Thanks for posting the solution you found, I wish more people did that.
Cheers!
-- Itzik Ben-Gan 2001
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply