hi i am writing the query to select all records for yesterday here is what i have
[code=sql]
select *
from ews_tiff.dbo.wh atever_merged
where datepart(yy,tim e_stamp) = datepart(yy,dat eadd(m,0,getdat e()))
and datepart(m,time _stamp) = datepart(m,date add(m,0,getdate ()))
and DATEPART(D,time _stamp)=datepar t(D,DATEADD(D,-1,GETDATE()))
[/code]
the column time_stamp is of type DATE
but when i run this query in the query analyser window it goes on debugging
any ideas , i am new to sql server
regards,
Omer Aslam
[code=sql]
select *
from ews_tiff.dbo.wh atever_merged
where datepart(yy,tim e_stamp) = datepart(yy,dat eadd(m,0,getdat e()))
and datepart(m,time _stamp) = datepart(m,date add(m,0,getdate ()))
and DATEPART(D,time _stamp)=datepar t(D,DATEADD(D,-1,GETDATE()))
[/code]
the column time_stamp is of type DATE
but when i run this query in the query analyser window it goes on debugging
any ideas , i am new to sql server
regards,
Omer Aslam
Comment