Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ravikiran
Starting Member
1 Post |
Posted - 2012-11-30 : 06:32:06
|
Hi Gurus,I'am quite new to SQL but keep using it :)I need some help with generating a report from few tables as in the following example. It would be helpful if anyone can explain me how to do this job:Table 1:Quote Color Grade1111 001 1111112 002 2221113 003 3331114 004 4441115 005 555Table 2:Id Color001 Green002 Violet003 Red004 Black005 OrangeTable 3:ID Grade111 Grade A222 Grade B333 Grade C444 Grade D555 Grade EReport:Quote Color Grade1111 Green Grade A1112 Violet Grade B1113 Red Grade C1114 Black Grade D1115 Orange Grade EI'll be using this on a mass scale for about 20 to 30 tables :) in a VBA module.Thanks in advance,cheers,Ravi. |
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2012-11-30 : 06:57:38
|
Create a stored procedure to deliver the data to the report.create proc s_rptasselect t1.Quote, t2.Color, t3.Gradefrom Table1 t1join Table2 t2 on t2.ID = t1.Colorjoin Table3 t3 on t3.ID = t1.Gradeorder by t1.Quote(You know you've mispelt Colour? :) )==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
|
|
|
|
|