| Author |
Topic |
|
sqlchild
Starting Member
4 Posts |
Posted - 2004-03-08 : 05:58:12
|
| This will be very easy to most people so I apologise.I have 2 tables one with invoice header information and one with the invoice detail information. I want to be able to get cost information from the detail table and show it against the customer account number held in the header table using the header id as the link that ties them together?Detail table fieldsheader_idquantityHeader table fieldsheader_idConf_idAny help suggestions greatfully received as I have switched to using something called SQL advantage which doesn't give me the help functionality etc of Query Analyzer!!! |
|
|
Frank Kalis
Constraint Violating Yak Guru
413 Posts |
Posted - 2004-03-08 : 06:56:34
|
Take a look at BOL for joins-SQL Server, innerSELECT h.header_id, d.quantityFROM Header_table h INNER JOIN Detail_table d ON h.header.id = d.header.idORDER BY h.headerid DESC --Frankhttp://www.insidesql.de |
 |
|
|
sqlchild
Starting Member
4 Posts |
Posted - 2004-03-08 : 09:04:37
|
HiCan't get it to work but thanks for your help any way. |
 |
|
|
Frank Kalis
Constraint Violating Yak Guru
413 Posts |
Posted - 2004-03-08 : 09:11:07
|
| Would you mind posting the table structure along with some sample data?--Frankhttp://www.insidesql.de |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-03-08 : 09:31:01
|
quote: Originally posted by sqlchild I have switched to using something called SQL advantage which doesn't give me the help functionality etc of Query Analyzer!!!
Why?And post the DDL...Do you use Enterprise Manager?Do you use Books Online?Brett8-) |
 |
|
|
sqlchild
Starting Member
4 Posts |
Posted - 2004-03-08 : 10:49:22
|
Not my choice on the swap thing, moved companies and thats how they choose to work with SQL, you select help and it just says things like "yes you idiot you can link a table but I'm not going to tell you how to check you've written your query right " or words to that effect! |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-03-08 : 11:25:27
|
| Hey, here's a brand new ferrari...It's got everything you need...But we'll keep the keys...huh?Brett8-) |
 |
|
|
sqlchild
Starting Member
4 Posts |
Posted - 2004-03-08 : 12:02:03
|
| At the moment all I get is to look at are the pretty pictures of the shiny new car I'm going to ask for but haven't got the courage!!!!! |
 |
|
|
ChrisFretwell
Starting Member
43 Posts |
Posted - 2004-03-08 : 12:31:11
|
| sqlchild, back to your original (and you have my sympathy from the sql advantage thing), but what do you mean by 'it doesnt work' with Frank's join? does it fail or does it just not return the records? |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2004-03-08 : 22:47:29
|
| by the way-- i believe Books ON-line is a free download from the microsoft site .. i'm sure someone has the link. even if you don't use QA, you can still reference books on-line.- Jeff |
 |
|
|
mohdowais
Sheikh of Yak Knowledge
1456 Posts |
Posted - 2004-03-09 : 01:15:59
|
quote: Originally posted by jsmith8858 by the way-- i believe Books ON-line is a free download from the microsoft site .. i'm sure someone has the link. even if you don't use QA, you can still reference books on-line.- Jeff
It's the first link on the SQLTeam FAQ!OS |
 |
|
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2004-03-09 : 08:33:29
|
| And I would Get my hands on a copy of SQL Install Disk and Install Enterprise Manager off of it if at all possible!!!Else you could also use MS Access version 2000 or greater it has some of the functionality of query analyzer in it.JimUsers <> Logic |
 |
|
|
|