Dim cmd As New OleDbCommand("select tbl_customers.cust_code, tbl_customers.cust_name from tbl_customers
where tbl_customers.cust_code not in (
select cust_code from tbl_paymint)", con)
con.Open()
tb_table2.Load(cmd.ExecuteReader)
dvg1.DataSource = tb_table2
con.Close()
وللمسددين احذف not من جملة الاستعلام .
هذا لجميع السجلات ،، ضيف عليهم شرط بالتاريخ المحدد .
27-12-18, 03:22 AM (آخر تعديل لهذه المشاركة : 27-12-18, 03:23 AM {2} بواسطة new_programer.)
شكرا استاذ حريف برمجة
الكود شغال تمام لكن عند وضع شرط لم يعمل يظهر خطاء
دة الكود بعد التعديل عفوا خبرتى قليلة
كود :
tb_table2.Clear()
Dim cmd As New OleDbCommand("select tbl_customers.cust_code, tbl_customers.cust_name from tbl_customers where tbl_customers.cust_code not in ( select cust_code from tbl_paymint)where tbl_paymint.mmonth= @mmonth", con)
cmd.Parameters.Add("@mmonth", OleDbType.VarChar).Value = txt_month.Text
con.Open()
tb_table2.Load(cmd.ExecuteReader)
dvg1.DataSource = tb_table2
con.Close()
Syntax error (missing operator) in query expression 'tbl_customers.cust_code not in ( select cust_code from tbl_paymint)where tbl_paymint.mmonth= @mmonth'.
27-12-18, 04:11 AM (آخر تعديل لهذه المشاركة : 27-12-18, 04:13 AM {2} بواسطة asemshahen5.)
كود :
Dim cmd As New OleDbCommand("select tbl_customers.cust_code, tbl_customers.cust_name from tbl_customers where tbl_customers.cust_code not in ( select cust_code from tbl_paymint where tbl_paymint.mmonth= @mmonth)", con)
سبحان الله وبحمده سبحان الله العظيم و الحمد لله ولا اله الا الله والله اكبر
Dim cmd As New OleDbCommand("select tbl_customers.cust_code, tbl_customers.cust_name from tbl_customers where tbl_customers.cust_code not in ( select cust_code from tbl_paymint where tbl_paymint.mmonth= @mmonth)", con)
Dim cmd As New OleDbCommand("select tbl_customers.cust_code, tbl_customers.cust_name from tbl_customers where tbl_customers.cust_code not in ( select cust_code from tbl_paymint where tbl_paymint.mmonth= @mmonth)", con)
Dim cmd As New OleDbCommand("select tbl_customers.cust_code, tbl_customers.cust_name from tbl_customers where tbl_customers.cust_code not in ( select cust_code from tbl_paymint where tbl_paymint.mmonth= @mmonth)", con)
شكرا جدا استاذى asemshahen5
بارك الله فيك وجعلة فى ميزان حساناتك
الكود شغال تمام
الكود دا هيشغل معاك اول شهر لكن مع الشهر التانى مش هيظهر لان البحث هيشوف بالعموم ان كود العميل موجود ولا لاء بغض النظر عن الشهر
اخي احمد
هل تريد مساعده فى الكود
وضح ايه المطلوب وسوف ارسل لك الكود
لو تريد عرض العملاء الغير مسددين لشهر
الكود يعمل بنجاح
لو عايز مساعد قولى المطلوب وان شاء الله اساعدك