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.

 All Forums
 Other Forums
 MS Access
 Format output query

Author  Topic 

kaus
Posting Yak Master

179 Posts

Posted - 2004-04-21 : 17:35:59
I've got two tables as shown below and want the output as shown below -- is there a way to do this just using SQL ?? I got it with VBA but would be very interested in learning a way with just SQL -- this stuff comes up a lot

Thanks

BOD_TSS Table
SiteNo Sample_Date BOD TSS
1 1/5/1999 360 360
1 1/15/1999 270 450
1 1/23/1999 350 499
2 1/6/1999 340 500
2 1/7/1999 340 500


MG Table
SiteNo Month MG
1 1/1/1999 890
2 1/1/1999 670

Format wanted:
SiteNo Sample_Date BOD TSS Month MG
1 1/5/1999 360 360 1/1/1999 890
1 1/15/1999 270 450
1 1/23/1999 350 499
2 1/6/1999 340 500 1/1/1999 670
2 1/7/1999 340 500

X002548
Not Just a Number

15586 Posts

Posted - 2004-04-23 : 12:01:59
There doesn't seem to be a relationship between the rows...

It seems arbitrary...

What rules do you use to slam them together?



Brett

8-)
Go to Top of Page

kaus
Posting Yak Master

179 Posts

Posted - 2004-04-23 : 19:25:25
I grouped them by month-year and site
Go to Top of Page
   

- Advertisement -