Click here to Skip to main content
15,664,272 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have written this statement in Visual Basic . It is giving me error (Syntax error missing operator in query expression)
VB
sql = "insert into m_temp (cust_id,invoice_no,invoice_dt,unique_id,po_no,wo_no,g_amount,status,icode,isrno,iqty,irate,iamount) select t0.cust_id,t0.invoice_no,t0.invoice_dt,t0.padi_no,t0.po_no,t0.wo_no,(t0.balance+t0.advance),t0.status,t1.icode,t1.srno,t1.qty,t1.rate_per_unit,t1.amount from salesinvoice t0 inner join padi_det t1 on t0.padi_no = t1.padi_no inner join padi_mast t2 on t1.padi_no = t2.padi_no where t0.cust_id = '" & FindCusCode & "' and t0.status <> 'C'"

Thanks
Posted
Updated 29-Jun-12 21:43pm
v2

1 solution

try
SQL
INSERT INTO m_temp 
(
	cust_id,
	invoice_no,
	invoice_dt,
	unique_id,
	po_no,
	wo_no,
	g_amount,
	status,
	icode,
	isrno,
	iqty,
	irate,
	iamount
)SELECT 
	t0.cust_id AS cust_id,
	t0.invoice_no AS invoice_no,
	t0.invoice_dt AS invoice_dt,
	t0.padi_no AS unique_id,
	t0.po_no AS po_no,
	t0.wo_no AS wo_no,
	(t0.balance + t0.advance) AS g_amount,
	t0.status AS status,
	t1.icode AS icode,
	t1.srno AS isrno,
	t1.qty AS iqty,
	t1.rate_per_unit AS irate,
	t1.amount  AS iamount
FROM 
	salesinvoice t0 INNER JOIN 
	padi_det t1 ON t0.padi_no = t1.padi_no INNER JOIN 
	padi_mast t2 ON t1.padi_no = t2.padi_no 
WHERE t0.cust_id = '" & FindCusCode & "' AND t0.status <> 'C'"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900