L
les
I have a form to search records by date of birth. The form has 3
dropdowns for day, month and year:
Dim strDOB as string = ("'" & dobday.selectedvalue & " " &
dobmonth.selectedvalue & " " & dobyear.selectedvalue & "'")
strDOB=DateTime.Parse(strDOB)
strSQL = "SELECT * FROM table1 where dob='" & strDOB & "' "
When i response.write the original string I get '04 March 1951'
When i response.write(strDOB) it gives me 04/03/1951 but the records
returned are those with the DOB: 03/04/1951.
If I select a day over 12 it gives the error:
The conversion of a char data type to a datetime data type resulted in
an out-of-range datetime value.
Presumably I need to format strDOB as UK date format eg: 25/12/1951,
but I've tried various things and no success. Can anyone help please?
Thanks
Leslie
dropdowns for day, month and year:
Dim strDOB as string = ("'" & dobday.selectedvalue & " " &
dobmonth.selectedvalue & " " & dobyear.selectedvalue & "'")
strDOB=DateTime.Parse(strDOB)
strSQL = "SELECT * FROM table1 where dob='" & strDOB & "' "
When i response.write the original string I get '04 March 1951'
When i response.write(strDOB) it gives me 04/03/1951 but the records
returned are those with the DOB: 03/04/1951.
If I select a day over 12 it gives the error:
The conversion of a char data type to a datetime data type resulted in
an out-of-range datetime value.
Presumably I need to format strDOB as UK date format eg: 25/12/1951,
but I've tried various things and no success. Can anyone help please?
Thanks
Leslie