Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 Fetching the data by using DATE field

Author  Topic 

kavi12345
Starting Member

19 Posts

Posted - 2012-03-02 : 03:24:45
hi,if we want to select the data by using DATE field,what should i do?..for example..consider a tablename as TBL1 which contains fields of customername,customercode,Date,products,Quantity..then the table have been using past 1 year(2011-2012)..so i want to select the records using DATE field..i.e...we have to select only the records using between 01-05-2011 to 01-01-2012..so for this solution,can we apply FOR condition??or anything else..please infor me guys...thans in advanc...

kavichakravarthi.R

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-03-02 : 03:28:33
[code]SELECT *
FROM TBL1
WHERE [Date] between '2011-05-01' and '2012-01-01'[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

kavi12345
Starting Member

19 Posts

Posted - 2012-03-02 : 06:47:24
@Kh:Once again thank you so much

kavichakravarthi.R
Go to Top of Page
   

- Advertisement -