Hi. I'm using vs2008 and I have a form where the user can enter data in a vehicle field or leave blank for all and I need to configure my sqldatasource for the gridview on that scenario. My current select is the code below and is based on the user having entered a "from" vehicle and a "to" Vehicle, but I would need to give the user the option of not entering anything into these fields.
SELECT TicketNo, UniqueID, TicketDate, LocationID, CustomerID, OrderID, VehicleID FROM JwsData1.Tkhist1 WHERE (LocationID = ?) AND (CustomerID = ?) AND (TicketDate >= ?) AND (TicketDate <= ?) AND (VehicleID >= ?) AND (VehicleID <= ?) ORDER BY TicketNo, UniqueID
These two fields are strings pertaining to a vehicle's license plate. Can this be done? Or do I need to assign a default value of "1" to the "From" vehicle and a default of "Z" to the "To" vehicle?
SELECT TicketNo, UniqueID, TicketDate, LocationID, CustomerID, OrderID, VehicleID FROM JwsData1.Tkhist1 WHERE (LocationID = ?) AND (CustomerID = ?) AND (TicketDate >= ?) AND (TicketDate <= ?) AND (VehicleID >= ?) AND (VehicleID <= ?) ORDER BY TicketNo, UniqueID
These two fields are strings pertaining to a vehicle's license plate. Can this be done? Or do I need to assign a default value of "1" to the "From" vehicle and a default of "Z" to the "To" vehicle?