Page 1 of 4 123 ... LastLast
Results 1 to 15 of 60
  1. #1
    Join Date
    Sep 2009
    Posts
    90

    Unanswered: Sales Summary Stored Procedure

    This is the sample database:

    [CODE]
    June 2009 Sales Report
    Store Code Item1units Item1value Item2units Item2value Item3units Item3values Item4units Item4values Item5units Item5value Total
    111 1 450 1 250 5 3750 1 1500 5950
    222 1 450 1 250 1 1500 2200
    333 2 900 1 750 1 640 2290
    444 5 2250 1 750 2 3000 2 1280 7280
    555 2 900 2 500 3 4500 1 640 6540
    TOTAL 11 4950 4 1000 7 5250 7 10500 4 2560 24260

    July 2009 Sales Report

    August 2009 Sales Report

    September 2009 Sales Report

    and so on...

    or

    http://img169.imageshack.us/img169/2761/dbstruct.jpg



    I don't know how to make a summary report with details for my database.
    Im using vb.net, sql server and crystal reports.

    I need to get the sales summary per item between months.

    Please help me to make a stored procedure for this.

    Thnx in advance!
    Last edited by rvr707; 10-19-09 at 01:34.

  2. #2
    Join Date
    Sep 2009
    Posts
    90
    anyone? i badly need this one

  3. #3
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    I don't mind helping you out with a problem, but looking at your last posts, it seems you are diverting your job tasks to this forum.

    You don't seem to have a good understanding of relational databases. That is not something to feel bad about, but if your job is working with them, you should take control and do something about it. Working with databases is not rocket science. The best thing you can do is take a course or read a good book about relational databases and do the exercises. You will find ample books referenced in the posts on this forum.

    Edit: typo removed
    Last edited by Wim; 10-19-09 at 13:41.
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  4. #4
    Join Date
    Sep 2009
    Posts
    90
    Quote Originally Posted by Wim
    I don't mind helping you out with a problem, but looking at your last posts, it seems you are diverting your job tasks to this forum.

    You don't seem to have a good understanding of relational databases. That is not something to be feel bad about, but if your job is working with them, you should take control and do something about it. Working with databases is not rocket science. The best thing you can do is take a course or read a good book about relational databases and do the exercises. You will find ample books referenced in the posts on this forum.
    Thanks for that!
    I was just making this for my school project.
    I'm still learning. And hopes to get knowledge also from all your suggestions.
    Thank you very much!

  5. #5
    Join Date
    Aug 2009
    Posts
    262
    I can help you and code you the procedure if you tell me how you want your report . I also work at sqlserver 2005/08 and use crystal report for report writing .

  6. #6
    Join Date
    Sep 2009
    Posts
    90
    Quote Originally Posted by mishaalsy
    I can help you and code you the procedure if you tell me how you want your report . I also work at sqlserver 2005/08 and use crystal report for report writing .
    Thank you so much!

    These are the queries that i need:
    (you just have to choose one then i'll do the rest base on your given example)

    -Sales by Customer Summary
    *Total sales per month

    -Sales by Customer Detail
    *Sales of product/s in a given branch

    -Sales by Item Summary
    *Sales of product/s

    -Sales by Item Detail

    -Sales by Rep Summary

    -Sales by Rep Detail

    All of this is within range of months, like for example, i have the option to select reports from june to august and so on...

    Thanks again! Reporting is really new to me...
    Last edited by rvr707; 10-20-09 at 07:43.

  7. #7
    Join Date
    Aug 2009
    Posts
    262
    can you give me sample ddl ,
    i.e create table and couple of rows Insert queries ... so i can make a quick start .
    i dont see item detail , rep summary detail . sale by rep detail .. any where in your given data .

    my email id is fh.syed@hotmail.com incase the data is sensetive .

  8. #8
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10

  9. #9
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    rvr707 - are what you listed in your first post tables or required reports? And are these tables ones you have built or were provided to you by your teacher?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  10. #10
    Join Date
    Sep 2009
    Posts
    90
    @pootle flump
    both. im the one who created it for samples

    sorry for all the misunderstanding! i really dont know where to start and quite confused.
    Last edited by rvr707; 10-21-09 at 12:06.

  11. #11
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    rvr707 - if these are tables you have built then you would do well to review these with your teacher before continuing to the reporting. These break so many good database design principles that you are in great danger of scoring very low marks irrespective of your reports.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  12. #12
    Join Date
    Sep 2009
    Posts
    90
    can you suggest on how will i reconstruct my table? should i remove anything or what?

  13. #13
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    To start off with, don't have one table per month. Have one single table with this data stored as values in columns. Second, have a look here at First Normal Form. You have designed a table almost identical to the example.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  14. #14
    Join Date
    Sep 2009
    Posts
    90
    Thank you! I learned a lot from all ur suggestions.
    I reviewed and browse my books and you are all right.

    But the problem is this, the data given to us is in excel format already.
    The challenge to us is to import it to sql and fix the data.
    I already know how to import using vb.net.
    But i imported it as it is. Meaning no change in data structure.
    That's why i came up with this problem. I think it would be to hard if i reconstruct the data design because they are so many. Just imagine, over 300 rows of sales transactions per month (The one that i post here is just a glimpse).
    I don't know if its really hard, or is there an easier way to redesign the table as i import it from excel? or i have to do it manually? (as in copy and pasting each row)

    btw, thanks a lot! I'm really learning from you guyz! This forum is great!

  15. #15
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Who has supplied you with the excel spreadsheets? Your teacher?
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •