Click here to Skip to main content
16,022,896 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Im Using Microsoft Visual Studio 2010, C# and SQL Server 2008 r2

I already created the report in report viewer but I don't know how to make a Weekly, Monthly and yearly report,
Posted
Updated 1-Feb-14 19:03pm
v3

I can't be accurate from that little information, but have a look at the DATEDIFF[^] function - it lets you select what data you want.
For this week:
SQL
SELECT * FROM MyTable WHERE DATEDIFF(ww, MyDateColumn, GETDATE()) = 0

For month:
SQL
SELECT * FROM MyTable WHERE DATEDIFF(mm, MyDateColumn, GETDATE()) = 0

And Year:
SQL
SELECT * FROM MyTable WHERE DATEDIFF(yy, MyDateColumn, GETDATE()) = 0
 
Share this answer
 
Comments
[no name] 1-Feb-14 3:56am    
+5..
Dude,

Use Crystal Reports,
write stored procedure n link it to ur CR.

call this CR in ur web.aspx

try this:
http://www.youtube.com/watch?v=DgpfTThogsk[^]

http://www.sourcecodester.com/blog/5232/download-crystal-reports-visual-studio-2012.html[^]
 
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