Combining two databases

kenny9002

Board Regular
Joined
Aug 22, 2010
Messages
211
Please I need help with combining two databases – Stock database and Sales database to enable me carry out analysis.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>
In our small family business, I use Excel/VBA to make both product Purchase and Sales entries onto Excel Workbook. I use a Data Entry Form to record Purchases of products (We buy different types of products – but only from one supplier). These entries are recorded onto a Purchase Database on Worksheet A. An example of the Purchase database is something like this: Each of the following headings go onto a column in the Purchase Database:
<o:p> </o:p>
Purchase Database:
  • Product
  • Quantity purchased
  • Date of Purchase
  • Unit Cost
I also use a Data Entry Form to record Sales of those products to different customers. The Database for the sales is on Worksheet B, and the column headings are as follows:
<o:p> </o:p>
Sales Database:
  • Name of Customer
  • Contact No.
  • Product sold
  • Quantity
  • Date of <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:City w:st="on"><st1:place w:st="on">Sale</st1:place></st1:City>
  • Unit Price
  • Amount Paid<o:p> </o:p>
My problem and where I need help is this: At any given time, I would want to analyze Sales by Date, Customer, Product, etc. and also be able to analyze Purchases by Date, Product and be able to determine and analyze unsold stock – if possible, by product.
<o:p> </o:p>
I suppose this would involve combining, somehow, the two databases. I don’t have a clue how to achieve this and should be grateful for help, please.
<o:p> </o:p>
If, however, any of the experts thinks that the method that I am currently using will not help me to achieve my aim, I am open to any suggestion/help with any other method of recording the purchases and sales – with a view to achieving the desired analyses.
<o:p> </o:p>
Thanks for your kind help.
<o:p> </o:p>
Kenny
 
Kenny;
Nice effort. You were very close. Look at this SQL and make sure to look at it in the design mode(commonly referred to as QBE)

Code:
SELECT (Month([DateOfSale])) AS [Month of Sale], [SALES DATABASE].ProductName, Sum([SALES DATABASE].QtySold) AS TotalQtySold, Sum([SALES DATABASE].TotalSales) AS TotalSalesPrice
FROM [SALES DATABASE]
GROUP BY (Month([DateOfSale])), [SALES DATABASE].ProductName;
You had a sum for the Month Dates versus a Group By and you needed to get only the month--not the exact date.
Alan
 
Last edited:
Upvote 0

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,224,540
Messages
6,179,417
Members
452,912
Latest member
alicemil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top