Solved

Sales Analysis Report

Posted on 2003-11-05
7
488 Views
Last Modified: 2008-03-06
Hi,

I would really appreciate if somebody could walk me throught the following report

I need to create a report with the following fields:

Customer Code | Customer Name | Sales month to date (current year) | Sales month to date (last year) | current year to date | last year to date | % Change by year

Say if this is october 10/31 I want to see all the customers with october sales till 31st for the current year and the same for last year.The year to date for current year and last year should be user defined dates and sppropriate totals

Fields in the table are:
sldno (customer Code)
Cusnme (Customer Name)
dteshp (Date Shipped)
total_net (total amount)

Please advice

Thanks,
kris
0
Comment
Question by:krisred
  • 4
  • 2
7 Comments
 
LVL 9

Expert Comment

by:svenkarlsen
ID: 9690578
I believe that's beyond the scope of this forum: you must ask for help with specific problems, - not a complete  report lay-out.

Kind regards,
Sven Karlsen
0
 
LVL 18

Accepted Solution

by:
bonjour-aut earned 500 total points
ID: 9690633
i will give you a start with the basic query you will need to seperate your sales history:

paste this to sqlview of a new query (but check for the tablename and the writing of the fieldnames !!)

SELECT SalHist.sIdno, SalHist.Cusnme, IIf(Month(Now())=Month([dteshp]) And Year(Now())=Year([dteshp]),[total_net],0) AS tm, IIf(Month(Now())=Month([dteshp]) And Year(Now())-1=Year([dteshp]),[total_net],0) AS tmly, IIf(Month(Now())+1>Month([dteshp]) And Year(Now())=Year([dteshp]),[total_net],0) AS tytd, IIf(Month(Now())+1>Month([dteshp]) And Year(Now())-1=Year([dteshp]),[total_net],0) AS lytd
FROM SalHist;

Regards, Franz
0
 
LVL 18

Expert Comment

by:bonjour-aut
ID: 9690663
furtheron you will need to build sums per customer

lets call the first query "qry_base"

SELECT qry_base.sIdno, qry_base.Cusnme, Sum(qry_base.tm) AS [Summe von tm], Sum(qry_base.tmly) AS [Summe von tmly], Sum(qry_base.tytd) AS [Summe von tytd], Sum(qry_base.lytd) AS [Summe von lytd]
FROM qry_base
GROUP BY qry_base.sIdno, qry_base.Cusnme;

this should be the datasource for your report

Regards, Franz
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 18

Expert Comment

by:bonjour-aut
ID: 9690723
i changed the fieldnames of the second query:

SELECT qry_base.sIdno, qry_base.Cusnme, Sum(qry_base.tm) AS [tm], Sum(qry_base.tmly) AS [tmly], Sum(qry_base.tytd) AS tytd], Sum(qry_base.lytd) AS [lytd]
FROM qry_base
GROUP BY qry_base.sIdno, qry_base.Cusnme;

i did a basic report with the %

download and fill in testdata:

http://www.tplus.at/~sissi-franz/test/srep.mdb

regards, Franz
0
 

Author Comment

by:krisred
ID: 9691008
Hi Fraz,

I really appreciate your help . It was very helpful.
I created the report and it work, but what the are the date ranges for last year and current year sales. Is it the calender year or ?
Is there any I can have a prompt for the dates?

Thanks again,

Kris
0
 

Author Comment

by:krisred
ID: 9691073
Hi Franz,

Also, when I create the percentage field I get a error running the query. I think its because of division by zero, if the last year sales were 0 then it creates a problem

Thanks,

Kris
0
 
LVL 18

Expert Comment

by:bonjour-aut
ID: 9692564
date ranges tytd and lytd

...Month(Now())+1>Month([dteshp]) ....

is actual month and all months before, same for this year and last year

otherwise a comparison would make liitle sense, i think

to avoid a null division error:

If you use A2000 or above, there is a Nz() function to wrap th Formula

otherwise you can exclude with an If-Clause
if you experience further problems post at this thread again

Regards, Franz

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now