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 |
|
dewacorp.alliances
452 Posts |
Posted - 2003-04-22 : 03:23:57
|
| Hi thereI have these 2 table:1) maBU_lupFOChargeCodeAccCompYTDBudget :FinanceCode VARCHAR(8);AccCompID(5);2003AnnualBudgetAmt FLOAT2) maBU_tblBudget :BudgetLineID INTFinanceCode VARCHAR(8);AccCompID VARCHAR(5)BudgetJul FLOATBudgetAugust FLOATBudgetSeptember FLOATThe question is :1) I want to have LEFT OUTER JOIN OF mabu_lupFOChargeCodeAccCompYTDBudget AND maBU_tblBudget where the join is coming from two fields FinanceCode AND AccCompID. There for if both value FinanceCode AND AccCompID (in the mabu_lupFOChargeCodeAccCompYTDBudget table) are the same with the value of FinanceCode AND AccCompID (in the maBU_tblBudget table) then join these two. Is this possible? 2) The impact of this query will have a null if data exist in the lupFOChargeCodeAccCompYTDBudget but not in the tblBudget. How to replacing NULL with ZERO into BudgetJuly, BudgetAugust and BudgetSeptember ?Any guidance or help I'm really appreciated?Thanks,Isadewa |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2003-04-22 : 07:27:43
|
select isnull(b.col3,0)from tablea a left join tableb b on (a.col1 = b.col1 and a.col2 = b.col2) Jay White{0} |
 |
|
|
|
|
|