منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : تعديل مثال العملاء الغير مسددين القسط
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
السلام عليكم

مرفق مثال ارجو التعديل او شرح كيف  يتم هذا الاستعلام

اريد عرض العملاء الغير مسددين لشهر او تاريخ ما

مرفق مثال ارجو التعديل
وعليكم السلام ،،

بالنسبة للغير مسددين كالتالي :

كود :
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 من جملة الاستعلام .

هذا لجميع السجلات ،، ضيف عليهم شرط بالتاريخ المحدد .
شكرا استاذ  حريف برمجة

الكود شغال تمام لكن عند وضع شرط لم يعمل يظهر خطاء

دة الكود بعد التعديل  عفوا خبرتى قليلة

كود :
  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'.

دة الخطاء
كود :
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)
(27-12-18, 04:11 AM)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)


شكرا جدا جارة التجربة
(27-12-18, 04:11 AM)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)

شكرا جدا استاذى  asemshahen5

بارك الله فيك وجعلة فى ميزان حساناتك

الكود شغال تمام
(27-12-18, 09:22 PM)new_programer كتب : [ -> ]
(27-12-18, 04:11 AM)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)

شكرا جدا استاذى  asemshahen5

بارك الله فيك وجعلة فى ميزان حساناتك

الكود شغال تمام

الكود دا هيشغل معاك اول شهر لكن مع الشهر التانى مش هيظهر لان البحث هيشوف بالعموم ان كود العميل موجود ولا لاء بغض النظر عن الشهر 


انا مازلت ابحث فى الموضوع ولم اجد حل 
راجع موضوعى دا
http://vb4arb.com/vb/showthread.php?tid=26482
اخي احمد
هل تريد مساعده فى الكود
وضح ايه المطلوب وسوف ارسل لك الكود
لو تريد عرض العملاء الغير مسددين لشهر
الكود يعمل بنجاح
لو عايز مساعد قولى المطلوب وان شاء الله اساعدك