SELECT Query in SQL Server 2000
-
Hi all, Facing small problem. I have one field of type SmallDateTime in SQL Server table and contains both date and time as a data. I want to get all records of specific date irrespective of time and i given following query like select firstname,paiddate from tbluser where paiddate = '24-mar-2005' is not showing any record because time part is also there. so what is the standard method to get all records of a particular date ignoring time part (not by using string functions like substring or left etc) Thanks for reply.
-
Hi all, Facing small problem. I have one field of type SmallDateTime in SQL Server table and contains both date and time as a data. I want to get all records of specific date irrespective of time and i given following query like select firstname,paiddate from tbluser where paiddate = '24-mar-2005' is not showing any record because time part is also there. so what is the standard method to get all records of a particular date ignoring time part (not by using string functions like substring or left etc) Thanks for reply.
-
Hi all, Facing small problem. I have one field of type SmallDateTime in SQL Server table and contains both date and time as a data. I want to get all records of specific date irrespective of time and i given following query like select firstname,paiddate from tbluser where paiddate = '24-mar-2005' is not showing any record because time part is also there. so what is the standard method to get all records of a particular date ignoring time part (not by using string functions like substring or left etc) Thanks for reply.
select firstname,paiddate from tbluser where datediff(day,paiddate,'24-mar-2005')=0