Skip to main content

Weekly Sales Report using Crystal Reports


The following source code will teach you on how to create a “Weekly Sales Report” using Crystal Reports. The most important part of this project is the use of SQL Statement. Here’s the statement that create a weekly sales report. SELECT TOP (100) PERCENT CONVERT(Varchar, DATEADD(WEEK, DATEDIFF(WEEK, CONVERT(DATETIME, '1900-01-01 00:00:00', 102), Date), CONVERT(DATETIME, '1900-01-01 00:00:00', 102)), 101) AS Date, SUM(Amount) AS Amount FROM dbo.Sales GROUP BY CONVERT(Varchar, DATEADD(WEEK, DATEDIFF(WEEK, CONVERT(DATETIME, '1900-01-01 00:00:00', 102), Date), CONVERT(DATETIME, '1900-01-01 00:00:00', 102)), 101) ORDER BY Date

This statement can be found on the SQL Server database that is included in the zip file.

You need to change the connection string just in case you’re using a different name like the one I used here - “LOCALHOST\SQLEXPRESS”.

Follow the tutorial on “How to Change Connection String of VB.NET Project at Design Time

Additionally, you will need to change the “ServerName” that is found under frmReports form as follows:

myConnectionInfo.ServerName = "LOCALHOST\SQLEXPRESS"

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

Submitted byAnonymous (not verified)on Wed, 02/23/2011 - 21:40

Hi Sir I need INVENTORY SYSTEM (sales)in visual basic 6.0 connecting to database Ms Access for thesis. I want you to cooperate with me in this project..I hope you will post for me to download it..

Thanks
jan

Submitted byHkassabon Mon, 03/07/2011 - 02:29

Thank You Very Much

Submitted byAnonymous (not verified)on Sat, 12/10/2011 - 00:39

Hi sir need your help...

I have a problem for reservation in my project.. the problem is if the Guest 1 want to reserve the room in 3 hrs
and the next Guest2 want to reserve the room in the same room..so i would like my system to do the reservation for have no conflict the time for my two Guest..

Thank you sir.. just sent you answer to my email account [email protected]

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.