Click here to Skip to main content
15,914,419 members

Comments by Nebilo (Top 28 by date)

Nebilo 24-Jun-14 8:53am View    
No i don't want to read the calculation.I wanted to write the calculation in vb.net and apply that when a record is read.
Nebilo 4-Jun-14 10:12am View    
It's showing me the logon prompt.I also used another code but didn't make a difference.Here's the link
http://msdn.microsoft.com/en-US/library/ms227750(v=vs.80).aspx
Nebilo 4-Jun-14 9:02am View    
It's not working
Nebilo 21-May-14 3:55am View    
Deleted
I tried using join statement,another condition in the statement.And it only worked for the first join.when i wrote the second join statement it raised an exception->Syntax error (missing operator) in query expression ''.

I removed the second join statement and it works fine.The error highlights on the 'AND' operator.

But what i want to know is why it is not working for the second join statement.Here's the code i used.
<pre lang="vb">SELECT pr.[project number],pr.[employee number],pr.[current month],pr.[net pay]," & _
"al.[net allowance],pda.[net] FROM [pay_roll] pr INNER JOIN [allowance] al ON pr.[project number]=al.[project number] AND " & _
"pr.[employee number]=al.[employee number] AND MONTH(pr.[current month])=MONTH(al.[current month]) AND YEAR(pr.[current month])=YEAR(al.[current month]) " & _
"JOIN [per_diem_accomodation] pda ON pr.[project number]=pda.[project number] AND " & _
"pr.[employee number]=pda.[employee number] AND MONTH(pr.[current month])= MONTH(pda.[current month]) AND YEAR(pr.[current month])=YEAR(pda.[current month])"</pre>
Nebilo 20-May-14 11:31am View    
Deleted
I tried using join statement.And it only worked for the first join when it raised an exception->Syntax error (missing operator) in query expression ''.

I removed the second join statement and it works fine.And BTW i forgot one condition to put in the query then put it and it gave me the right result.

But what i want to know is why it is not working for the second join statement.

"INSERT INTO patempTable SELECT pr.[project number],pr.[employee number],pr.[current month],pr.[net pay]," & _
"al.[net allowance] FROM [pay_roll] pr INNER JOIN [allowance] al ON pr.[project number]=al.[project number] AND " & _
"pr.[employee number]=al.[employee number] AND MONTH(pr.[current month])=MONTH(al.[current month]) AND YEAR(pr.[current month])=YEAR(al.[current month])"

The above statement joins the two tables [pay roll] and [allowance]

"JOIN [per_diem_accomodation] pda ON pr.[project number]=pda.[project number] AND " & _
"pr.[employee number]=pda.[employee number] AND MONTH(pr.[current month])= MONTH(pda.[current month]) AND YEAR(pr.[current month])=YEAR(pd.[current month])"

When i add this statement to the previous code it raises an exception