Get Expiry Date

Jake

New member
Joined
Apr 13, 2019
Messages
2
Location
Philippines
Programming Experience
1-3
Hi,
Question, I was trying to get expiry date from my database, I already got those list display on my Listview.
But when Im trying to update the year. Still showing on my list.

sample Date today is 13-Apr-2019, i want to display those upcoming expiry +30 Days.
but if I update it to 13-Apr-2020, still showing.

My code i use.

"Select * from TblEmployee where IDExpiry<=@IDExpiry"
siemdi.Parameters.Add("@IDExpiry", OleDbType.Date).Value = DateTime.Today.AddDays(30)
 

Jake

New member
Joined
Apr 13, 2019
Messages
2
Location
Philippines
Programming Experience
1-3
im using Access Database.

my complete code.

Dim dtt As New DataTable
Dim adp As New OleDbDataAdapter
LVExpired.Clear()
LVExpired.Visible = True
LVExpired.View = View.Details
LVExpired.GridLines = True
LVExpired.FullRowSelect = True
LVExpired.Columns.Add("Empl. ID", 100)
LVExpired.Columns.Add("Empl. Name", 120)
LVExpired.Columns.Add("ID Exp.", 100)
Dim Load As String = "Select * from TblEmployee where IDExpiry<=@IDExpiry"
siemdi = New OleDbCommand(Load, cns)
siemdi.Parameters.Add("@IDExpiry", OleDbType.Date).Value = DateTime.Today.AddDays(30)
Try
cns.Open()
adp = New OleDbDataAdapter(siemdi)
adp.Fill(dtt)

For Each row In dtt.Rows
PopulateExpired(row(2).ToString, row(5).ToString, row(14).ToString)
Next
dtt.Rows.Clear()
cns.Close()
Catch ex As Exception
MsgBox(ex.Message)
cns.Close()
End Try
 
Last edited:
Top Bottom