Click here to Skip to main content
15,905,587 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am creating a c sharp sql server project and I wanted to getting a particular year entries in the beginning form. In beginning form i will select a year means 2010,2011,etc. and when i select go a mdi screen will displays. when i perform any operation the entries must be the same year. Means if i click 2010 in beginning form, i have to get only year 2010 values for all modules and reports
Posted

1 solution

Use
Datepart of sql server

as
SQL
select *from tablename where DATEPART ( year , date )=2010;
 
Share this answer
 
Comments
Arthesh G 23-Jan-12 5:07am    
1. if i wanted from 1-4-2010 to 31-3-2011 then what i have to do?
2. Am i able to view only the selected date values to all modules including reports? I think i have to create a class and global variable
uspatel 23-Jan-12 6:43am    
1: use BETWEEN in SQL Query
2: Use parametrized report and parameter will be date......

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