Click here to Skip to main content
15,886,798 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
Hello to all.

Problem in select data from table month wise.
I want to fetch data from my table which has a column named date.
I want to retrieve data by month and year but not with date.
Can any one tell me the solution.
Thanks.
Posted

1 solution

Create a datetime value of the first day of the month and the last day of the month, then use those in a SQL SELECT statement with a BETWEEN clause??
 
Share this answer
 
Comments
Mohd Imran Saifi 9-May-12 2:31am    
Is their is not any solution while i choose month wise record in from the full date.
Dave Kreskowiak 9-May-12 21:24pm    
Are you kidding? That IS the solution, unless you've written your database to have the date broken out into seperate columns, which I doubt.

What, you want everything like this simple little problem handed to you and done for you? You write code for a living, so write some code to do what you want!

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