Date Time Picker Problem
I am using the Date Time Picker component in development. I have 2 DTP which are the dtpStartDate and dtpEndDate respectively. The format properties of the DTP is set as SHORT.
When I fire the below SQL, I've detected the wrong output appear. Below is my SQL
strSQL = "select * from Quotation where DeliveryDate>='" & dtpStartDate.value & "' and DeliveryDate<='" & dtpEndDate.value & "'
Example of DTP input through screen
a) dtpStartDate : 03/01/2009 (format: mm/dd/yyyy)
b) dtpEndDate : 03/10/2009 (format: mm/dd/yyyy)
Sample Output consists of data from 01/03/2009 (meaning : Jan 03 3009) to 10/03/2009 (meaning : Oct 03 2009).
The SQL Server uses the default date setting during the instalaltion time.
DeliveryDate field is set as smalldatetime format.
Anyone can advise how to format the Date Time Picker component to work correctly on the output INSTEAD of changing the SQL Server date setting?
|