تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
مثال للبحث بين تاريخين مشكلة تستحق الاهتمام
#32
هذا كود بحث بين تاريخين شغال 100%

Dim query As String = "Select * From [Salary] Where [date1] Between @date1 And @date2"
Dim commandSelect As New SqlCommand(query, con)

commandSelect.Parameters.AddWithValue("@date1", DateTimfirst.Value.Date)
commandSelect.Parameters.AddWithValue("@date2", DateTimeend.Value.Date)
dr = commandSelect.ExecuteReader
While dr.Read()

If (dr(1) = TextBoxco.Text) And (TextBoxtypsal.Text = "Hour Works") Then
total_adver = total_adver + dr(5)
total_bonus = total_bonus + dr(6)
payhour = payhour + dr(7)
total_sal_weeek = payhour + total_bonus - total_adver
End If

If (dr(1) = TextBoxco.Text) And (TextBoxtypsal.Text = "Ended Works") Then
total_adver = total_adver + dr(5)
total_bonus = total_bonus + dr(6)
oayquntite = oayquntite + dr(8)
total_sal_weeek = oayquntite + total_bonus - total_adver
End If

If (dr(1) = TextBoxco.Text) And (TextBoxtypsal.Text = "Week's Statec") Then
total_adver = total_adver + dr(5)
total_bonus = total_bonus + dr(6)
total_sal_weeek = week + total_bonus - total_adver
End If
End While

Labeltotbonus.Text = total_bonus
Labeltotadver.Text = total_adver
Labeltotsal.Text = total_sal_weeek

con.Close()
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
RE: مثال للبحث بين تاريخين مشكلة تستحق الاهتمام - بواسطة samawi - 15-04-17, 02:27 AM


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم