Select addresses which are between ‘1/1/2004’ and ‘1/4/2004’?

 Posted by ArticlesMaint on 10/3/2009 | Category: Sql Server Interview questions | Views: 11052

Following SQL Statement can be used, please replace the date accordingly.

Select * from Person.Address where modifieddate between '1/1/2004' and '1/4/2004'

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Puneet20884 on: 12/23/2009
select address from tblAddress where CreatedDateTime between cast('1/1/2008' as datetime) and cast('1/4/2009' as datetime)
Posted by: Prabhakar on: 1/20/2011
i think use DATEDIFF function to fetch diffrence of date

SELECT DATEDIFF(dd,"24 March 1964","24 March 2001")
dd is return diffrence

Thanks & regard's

Login to post response