Public Sub Promotion()
Conn.Open()
Date.Today.ToString()
command = New OleDbCommand("select * from promotion where flag is null And ((date_begin between #" + Date.Today.ToString("MM/dd/yyyy", connect.st) + "# and #" + Date.Today.ToString("MM/dd/yyyy", connect.st) + "#) OR (date_end between #" + Date.Today.ToString("MM/dd/yyyy", connect.st) + "# and #" + Date.Today.ToString("MM/dd/yyyy", connect.st) + "#))", Conn)
Dim sr As OleDbDataReader = command.ExecuteReader
While sr.Read()
Rentfree = sr(3).ToString()
free = sr(4).ToString()
End While
sr.Close()
Conn.Close()
If Rentfree > 0 Then
Me.LblPromotion.Text = "โปรโมชั่น เช่า " + Rentfree.ToString() + " เล่ม แถม " + free.ToString() + " เล่ม"
Else
Me.LblPromotion.Text = "โปรโมชั่น เช่า - เล่ม แถม - เล่ม"
End If
End Sub