I am new to Visual Basic as well as Stackoverflow. I am querying certain fields from a database but receiving an error. here's my code:
Dim fifdate As Date = Now()
fifdate.AddDays(-15)
db.AddParam("collected", "N")
db.AddParam("printed", "Y")
db.AddParam("sent", "Y")
db.AddParam("date", fifdate)
Dim query As String = "Select * from badcheck where fldcollected =
@collected And fldprinted = @printed And fldsentda = @sent "
'And fldsentdate > @date
db.ExcecuteQuery(query)
CheckedListBox1.DataSource = db.DBDT
if i add the commented out section into the query, i get the error "Data type mismatch in criteria expression", but the query works perfectly fine without it. I know for sure that fldsentdate is set as a date in the database. any suggestion on how the issue can be fixed?