W
Wired Hosting News
OK... I have taken your advice and have change my way of thinking and
switched from Excel thoughts to Access thoughts. With respect for my
scenario of a manufacturer that sells 11 items to 1800 stores, I have
created the following tables with the following fields. Could you look at it
and tell me if I am on the right track?
As for setting up the relationships, I am a little confused.
Is this Normalized???
Also Pat... you had given me some query samples. Do I type those in on the
fly. Do they get coded into a VBA mod or a form mod. See bottom of this
page for what you sent me.
*** Store List Table ***
Store Number - Primary Key
Store Name
Market Number
Address
City
State
ZipCode
Phone Number
Fax Number
*** Products Available***
Part Number - Primary Key
UPC Number
Description
Size
Cost
Buy Pack
*** Products In the Chain Store *** One market has 2 extra items so I guess
I have to list every market and every skuu available in that market.
Market Number - Primary Key
Part Number
Sku Number
*** Sales Data Table ***
AutoGenerated - Primary Key
StoreNumber - Foriegn Key
Sku Number - Foreign Key
Inventory On Hand
*** Purchase Order Data Table ***
Store Number-
Sku Number
Purchase Order Number
Quantity Ordered
Due Date
Queries given by Pat:
If your tables are properly normalized, this query will give you total sales
by week, by store:
Select StoreID, Year(SalesDate) & "/" & Format(SalesDate,"ww") As YearWeek,
Sum(SalesPrice) as SumSalesPrice
From YourTable
Group By StoreID, Year(SalesDate) & "/" & Format(SalesDate,"ww");
If you want a single store and a single week, you can use a parameter query
to prompt you:
Select StoreID, Year(SalesDate) & "/" & Format(SalesDate,"ww") As YearWeek,
Sum(SalesPrice) as SumSalesPrice
From YourTable
Where StoreID = [Enter store ID] AND Year(SalesDate) & "/" &
Format(SalesDate,"ww") = [Enter Year/Week]
Group By StoreID, Year(SalesDate) & "/" & Format(SalesDate,"ww");
Plus I would also like to get average national sales for all stores on
any given SKU.
If your tables are properly normalized, this query will give you an average
for each store:
Select StoreID, SKU, Avg(SalesPrice) As AvgSalesPrice
From YourTable
Group By StoreID, SKU;
If you really want just a single store, you can use a parameter query to
prompt you:
Select StoreID, Avg(SalesPrice) As AvgSalesPrice
From YourTable
Where StoreID = [Enter store ID]
Group By StoreID, SKU;
switched from Excel thoughts to Access thoughts. With respect for my
scenario of a manufacturer that sells 11 items to 1800 stores, I have
created the following tables with the following fields. Could you look at it
and tell me if I am on the right track?
As for setting up the relationships, I am a little confused.
Is this Normalized???
Also Pat... you had given me some query samples. Do I type those in on the
fly. Do they get coded into a VBA mod or a form mod. See bottom of this
page for what you sent me.
*** Store List Table ***
Store Number - Primary Key
Store Name
Market Number
Address
City
State
ZipCode
Phone Number
Fax Number
*** Products Available***
Part Number - Primary Key
UPC Number
Description
Size
Cost
Buy Pack
*** Products In the Chain Store *** One market has 2 extra items so I guess
I have to list every market and every skuu available in that market.
Market Number - Primary Key
Part Number
Sku Number
*** Sales Data Table ***
AutoGenerated - Primary Key
StoreNumber - Foriegn Key
Sku Number - Foreign Key
Inventory On Hand
*** Purchase Order Data Table ***
Store Number-
Sku Number
Purchase Order Number
Quantity Ordered
Due Date
Queries given by Pat:
If your tables are properly normalized, this query will give you total sales
by week, by store:
Select StoreID, Year(SalesDate) & "/" & Format(SalesDate,"ww") As YearWeek,
Sum(SalesPrice) as SumSalesPrice
From YourTable
Group By StoreID, Year(SalesDate) & "/" & Format(SalesDate,"ww");
If you want a single store and a single week, you can use a parameter query
to prompt you:
Select StoreID, Year(SalesDate) & "/" & Format(SalesDate,"ww") As YearWeek,
Sum(SalesPrice) as SumSalesPrice
From YourTable
Where StoreID = [Enter store ID] AND Year(SalesDate) & "/" &
Format(SalesDate,"ww") = [Enter Year/Week]
Group By StoreID, Year(SalesDate) & "/" & Format(SalesDate,"ww");
Plus I would also like to get average national sales for all stores on
any given SKU.
If your tables are properly normalized, this query will give you an average
for each store:
Select StoreID, SKU, Avg(SalesPrice) As AvgSalesPrice
From YourTable
Group By StoreID, SKU;
If you really want just a single store, you can use a parameter query to
prompt you:
Select StoreID, Avg(SalesPrice) As AvgSalesPrice
From YourTable
Where StoreID = [Enter store ID]
Group By StoreID, SKU;