Dear All,
I have create a table in MSSQL 7.0 server like the below.
Table Name : MyUser
Field 1 : UserId varchar (20)
Filed 2 : BirthDate DateTime
Sample Data From SQL Server Enterprise Manager Console:
userid birthdate
-------------------- ---------------------------
abc 7/20/2002 12:29:06 PM
xyz 7/20/2002 12:29:28 PM
Sample Data From SQL Server Query Manager:
userid birthdate
-------------------- ---------------------------
abc 2002-07-20 12:29:05.623
xyz 2002-07-20 12:29:27.857
I wrote a sql statement in VB appliacation like this
Select * from myuser where birthdate = '7/20/2002'.
But I cant get any record. How do I select only using partial date or partial time only? According to MSDN, I should use "Like", but I still cant figure it out.
Anyone know how to handle date time in VB and MSSQL server ?
Best Regard,
the rockyu
I have create a table in MSSQL 7.0 server like the below.
Table Name : MyUser
Field 1 : UserId varchar (20)
Filed 2 : BirthDate DateTime
Sample Data From SQL Server Enterprise Manager Console:
userid birthdate
-------------------- ---------------------------
abc 7/20/2002 12:29:06 PM
xyz 7/20/2002 12:29:28 PM
Sample Data From SQL Server Query Manager:
userid birthdate
-------------------- ---------------------------
abc 2002-07-20 12:29:05.623
xyz 2002-07-20 12:29:27.857
I wrote a sql statement in VB appliacation like this
Select * from myuser where birthdate = '7/20/2002'.
But I cant get any record. How do I select only using partial date or partial time only? According to MSDN, I should use "Like", but I still cant figure it out.
Anyone know how to handle date time in VB and MSSQL server ?
Best Regard,
the rockyu