J
J P Singh
Hi All
I am trying to query a database with a combination of surname and date of
birth but it is giving me wrong results in certain conditions.
It is the mm/dd/yyyy and dd/mm/yyyy stuff that is not making it work.
If I enter date like 25/12/1976 then it works fine as the date will not be
valid like 12/25/1976 and everything works fine and my query executes
properly.
However if I enter a date like 07/08/1976 (07-Aug-1976) it think the query
thinks I have entered 08/07/1976 (08-July-1976) and brings back the wrong
result.
Can some one please help.
I am using the code below
strDateofBirth = request.form("dd") & "/ & request.form("mm") & "/ &
request.form("yy")
MySql="select * from empprofile where lastname ='"&strSurname&"' and
dateofbirth = #" & strDateofBirth &"#"
RS.open MySql,conn
I am trying to query a database with a combination of surname and date of
birth but it is giving me wrong results in certain conditions.
It is the mm/dd/yyyy and dd/mm/yyyy stuff that is not making it work.
If I enter date like 25/12/1976 then it works fine as the date will not be
valid like 12/25/1976 and everything works fine and my query executes
properly.
However if I enter a date like 07/08/1976 (07-Aug-1976) it think the query
thinks I have entered 08/07/1976 (08-July-1976) and brings back the wrong
result.
Can some one please help.
I am using the code below
strDateofBirth = request.form("dd") & "/ & request.form("mm") & "/ &
request.form("yy")
MySql="select * from empprofile where lastname ='"&strSurname&"' and
dateofbirth = #" & strDateofBirth &"#"
RS.open MySql,conn