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 |
mdixon44
Starting Member
26 Posts |
Posted - 2009-02-07 : 12:54:59
|
I really need some assistance with this one.Bob and sue are thinking about getting married. As a first step they have decided to keep track of their daily expenses in a single database. Bob’s expenses currently are in the table ex1501_bob. It has one column: Cost. Sue’s expenses are currently in the table ex1501_sue. It has three columns: item, price, and date_purchased. Both tables use positive numbers for credits and negative numbers for debits.Here is what I know about this.I know that I have to match the cost column of Bob table with the price column of Sue's table. I also know that Sue's table must be in first select statement.Here is what I have come up with.SELECT price, null as debits, price as credits,FROM ex1501_sueWHERE price > 0UNION ALLSELECT cost as price,FROM ex1501_bobWHERE cost is < 0OR cost is null;I have enter the code in Access and I have getting SELECT errors in Access. If someone can assist me with this, I would greatly appreciate it. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
mdixon44
Starting Member
26 Posts |
Posted - 2009-02-07 : 15:28:14
|
I would like to create a query the credit and debits from both tables. |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|