Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to get list records between two given date for my project plz help...
Posted

hi,


select * from tablename where datefieldname between '02/01/2013' and '02/28/2013'

or

select * from tablename where datefieldname >='02/01/2013' and dateFieldName<='02/28/2013'


regards,
Prakash.T
 
Share this answer
 
SQL
select * from tablename where datefieldname >='2013-02-25 00:00:00' and dateFieldName<='2013-02-27 00:00:00'



Note (Datatype is Datetime):
when you select the records between a particular date,you should keep date formats in mind.
SQL server default datetime format is yyyy-MM-dd HH:mm:ss
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900