| Author |
Topic |
|
sunita
Starting Member
8 Posts |
Posted - 2010-08-12 : 07:09:16
|
| SELECT TOP (100) PERCENT b.bill_no, b.date, b.Amount, c.bill_no ASExpr3, c.current_dat, em.date_adv_pay, em.adv_pay, ex.Date_of_expense,ex.Amount AS Expr5, ep.Date_of_Expense AS Expr6,ep.Amount AS Expr7, en.bill_no AS Expr1,en.date AS Expr2, en.total, c.total AS Expr4FROM bill_receive_entry b,cus_pay_detail c,emp_pay em,expense_personnel ex,expense_prod ep,enlarge enwhere b.date(+)=c.current_datand em.date_adv_pay=c.current_dat(+)and ex.Date_of_expense = em.date_adv_pay(+)and ep.Date_of_Expense = ex.Date_of_expense (+)and en.date = ep.Date_of_Expense(+)ORDER BY c.current_dat, c.bill_no, b.bill_no, em.date_adv_pay,ex.Date_of_expense, ep.Date_of_Expense, en.dateBut the error is coming like, I am not able to detect the prob. Actually I am a fresher in sql. so plz do help it,s urgntMsg 102, Level 15, State 1, Line 10Incorrect syntax near ‘)’. |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-08-12 : 07:10:46
|
What is that?b.date(+)Are you using MS SQL Server? No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
sunita
Starting Member
8 Posts |
Posted - 2010-08-12 : 07:12:47
|
| (+) is used for full outer join, I want to retrieve all data in current date |
 |
|
|
sunita
Starting Member
8 Posts |
Posted - 2010-08-12 : 07:14:03
|
| yes for MS-SQL |
 |
|
|
sunita
Starting Member
8 Posts |
Posted - 2010-08-12 : 07:30:09
|
| what happen????Please reply soon I am waiting...... |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-08-12 : 07:36:27
|
You know you shouldn't use these old kinds of joining?It will only work in 2000 or before or 2005 with compatibility level 80...And FULL OUTER JOIN was like this I think:where a.Column *=* b.Column No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
kashyap_sql
Posting Yak Master
174 Posts |
Posted - 2010-08-12 : 07:44:44
|
| elaborate your needWith RegardsKashyap M |
 |
|
|
sunita
Starting Member
8 Posts |
Posted - 2010-08-13 : 03:05:53
|
| No!!!!!!!!!!It's not working.Again same error |
 |
|
|
sunita
Starting Member
8 Posts |
Posted - 2010-08-13 : 03:09:21
|
| I am working in .net. I want to join all 6 tables using full outer join so that it will retrieve null values also. Condition to b used is: have to join in current date. |
 |
|
|
sunita
Starting Member
8 Posts |
Posted - 2010-08-13 : 03:28:01
|
| SELECT TOP (100) PERCENT b.bill_no, b.date, b.Amount, c.bill_no AS Expr3, c.current_dat, em.date_adv_pay, em.adv_pay, ex.Date_of_expense, ex.Amount AS Expr5, ep.Date_of_Expense AS Expr6, ep.Amount AS Expr7, en.bill_no AS Expr1, en.date AS Expr2, en.total, c.total AS Expr4FROM dbo.bill_receive_entry AS b FULL OUTER JOIN dbo.cus_pay_detail AS c ON b.date = c.current_dat FULL OUTER JOIN dbo.emp_pay AS em ON c.current_dat = em.date_adv_pay FULL OUTER JOIN dbo.expense_personnel AS ex ON em.date_adv_pay = ex.Date_of_expense FULL OUTER JOIN dbo.expense_prod AS ep ON ex.Date_of_expense = ep.Date_of_Expense FULL OUTER JOIN dbo.enlarge AS en ON ep.Date_of_Expense = en.dateORDER BY c.current_dat, Expr3, b.bill_no, em.date_adv_pay, ex.Date_of_expense, Expr6, Expr2This is working properly, bt in asp.net if i want to give condition then its nt working...Can anybdy help me......HELP!!!!!!!!!!!!!!!!! |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-08-13 : 03:29:57
|
| "I want to join all 6 tables using full outer join"Use FULL OUTER JOIN syntax then, not obsolete / deprecated (+) or (*) syntax |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-08-13 : 03:32:14
|
| "bt in asp.net if i want to give condition then its nt working"What condition?What error message? |
 |
|
|
remyo
Starting Member
6 Posts |
Posted - 2010-08-13 : 03:56:12
|
| As some people said .. use full outer joins.Dunno which condition you wanna add but should look something like where table.field_contaning_date = selected_dateSELECT b.bill_no, b.DATE, b.amount, c.bill_no AS expr3, c.current_dat, em.date_adv_pay, em.adv_pay, ex.date_of_expense, ex.amount AS expr5, ep.date_of_expense AS expr6, ep.amount AS expr7, en.bill_no AS expr1, en.DATE AS expr2, en.total, c.total AS expr4 FROM bill_receive_entry b FULL OUTER JOIN cus_pay_detail c ON b.DATE = c.current_dat FULL OUTER JOIN emp_pay em ON em.date_adv_pay = c.current_dat FULL OUTER JOIN expense_personnel ex ON ex.date_of_expense = em.date_adv_pay FULL OUTER JOIN expense_prod ep ON ep.date_of_expense = ex.date_of_expense FULL OUTER JOIN enlarge en ON en.DATE = ep.date_of_expense ORDER BY c.current_dat, c.bill_no, b.bill_no, em.date_adv_pay, ex.date_of_expense, ep.date_of_expense, en.DATE |
 |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2010-08-13 : 04:26:47
|
| how are you passing in this SQL statement to SQL Server?Is your string holding it "long enough" to hold all the text? Is there any chance it is being truncated?otherwise I agree with the "Full Outer" syntax comments above |
 |
|
|
Kristen
Test
22859 Posts |
|
|
sunita
Starting Member
8 Posts |
Posted - 2010-08-14 : 02:03:17
|
But,if i want to give condition in.net for a particular date or month,then same error is coming,the condition is like this:Sqlcommand cmd=new Sqlcommand("Select .............. where b.date='"+combobox_date.selectedtext+"'",con);why this is coming?????????? |
 |
|
|
|