I'm trying to get data that are equals to and between 2 dates that i type into my textbox! The column of PO_Date is of DateTime. It works perfectly when i hard code the dates into the select statement, for example PO_Date >= #12/6/2013 3:54:15 PM# AND PO_Date <= #1/1/2015 3:54:15 PM#
inclusive of the DropDownList2. The error only comes once i try to implement the txtStartDate.Text
and txtEndDate.Text
! Help is very much appreciated!
oRs.Open("SELECT PO_Date, PO.Vendor FROM PO
WHERE PO_Date >= '#" & TxtStartDate.Text & "00:00:00 AM""#' AND
PO_Date <= '#" & TxtEndDate.Text & "00:00:00 AM""#'
AND Vendor Like '%" & DropDownList2.SelectedValue & "%'", oCnn)