12-12-12, 05:13 PM
السلام عليكم ورحمة الله وبركاته
هل هذا الكود هو المطلوب :confused:
****
***
**
*
كود :
Dim Sql As String = ""
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim OrderToday As Date = Now.ToShortDateString
Sql = "Select * form [YourTable] Where OrderDate =#" & OrderToday & "#"
MsgBox(Sql)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim OrderYesterday As Date = Now.AddDays(-1).ToShortDateString
Sql = "Select * form [YourTable] Where OrderDate =#" & OrderYesterday & "#"
MsgBox(Sql)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim dateToday As Date = Now.ToShortDateString
Dim OrderWeek As Date = Now.AddDays(-7).ToShortDateString
Sql = "Select * form [YourTable] Where OrderDate >=" & dateToday & "# And OrderDate <=#" & OrderWeek & "#" ' لمعرفة الطلبات المخزنة بين التاريخين
MsgBox(Sql)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim dateToday As Date = Now.ToShortDateString
Dim OrderMonth As Date = Now.AddDays(-30).ToShortDateString
Sql = "Select * form [YourTable] Where OrderDate >=" & dateToday & "# And OrderDate <=#" & OrderMonth & "#" ' لمعرفة الطلبات المخزنة بين التاريخين
MsgBox(Sql)
End Subهل هذا الكود هو المطلوب :confused:
****
***
**
*

