473,394 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Expression frustration and a form question

Hi all.

I'm trying to write my first Access database and I'm getting on well. It's
for my own small business use and the scenario is this. I have 4 or 5
suppliers who all email their product pricing and databases daily. As they
all use different formats etc, I have linked all their data and import using
append queries into a single table in a format of my choice. I then
manipulate the data and use it to update my pricing according.

I have 2 problems.

1. Once the pricing has been updated, I want to produce a report showing me
profit margins as confirmation that I've updated my prices correctly. I'm
drawing data from 2 tables, one being my own price table ("tbl_SAGE") and
the other being the full list as above ("tbl_full_list"). Because my price
is based on the cheapest supplier who happens to have stock, I use a select
query with the following fields:
product_code; manu_part_no; description; cost_price; sale_price; stock
(I use manu_part_no as the link between tables, showing all in tbl_SAGE and
those in tbl_full_list that match)
All the fields draw from tbl_SAGE except for cost_price & stock which come
from tbl_full_list. cost_price uses MIN in the total field to find the
cheapest price. What I need to do is filter out all the "0" stock levels,
however because I'm using totals it seems to ignore the MIN and shows all
matching manu_part_no that <> "0".

What I'm looking to achieve is tbl_SAGE pulls from tbl_full_list the minimum
cost_price for the product that matches manu_part_no and the stock quantity
(ignoring zero stock). I've tried DLOOKUP as an expression but without a
form to draw from I've been stuck.

This is harder to describe than I thought! Bearing in mind I don't think
i've made myself clear, I'll skip question 2 for now else this'll be a long
post!

Would anyone have any advice?

Kind regards,
Michael
Nov 12 '05 #1
2 1339
This should give you what you need. It stacks one query on top of another.

1. Create a query into tbl_full_list price.

2. Depress the Total button on the toolbar (upper sigma icon).
Access adds a Total row to the grid.

3. Drag the ProductID into the output grid.
Accept "Group By" in the Total row.

4. Drag the price field into the grid.
Choose "Min" in the Total row.

5. Drag the quantity field into the grid.
Choose "Where" in the Total row.
In the Criteria for, enter >0

6. Save the query.

7. Create another query into your own price list (tbl_SAGE), your product
list, and the query above. You should have a join between product and the
other two only (i.e. no join between the query and tbl_SAGE).

8. Drag whatever fields you want into the output grid, and base the report
on that.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Michael Plant" <iu*****@hotmail.com> wrote in message
news:10****************@ersa.uk.clara.net...

I'm trying to write my first Access database and I'm getting on well. It's
for my own small business use and the scenario is this. I have 4 or 5
suppliers who all email their product pricing and databases daily. As they
all use different formats etc, I have linked all their data and import using append queries into a single table in a format of my choice. I then
manipulate the data and use it to update my pricing according.

I have 2 problems.

1. Once the pricing has been updated, I want to produce a report showing me profit margins as confirmation that I've updated my prices correctly. I'm
drawing data from 2 tables, one being my own price table ("tbl_SAGE") and
the other being the full list as above ("tbl_full_list"). Because my price
is based on the cheapest supplier who happens to have stock, I use a select query with the following fields:
product_code; manu_part_no; description; cost_price; sale_price; stock
(I use manu_part_no as the link between tables, showing all in tbl_SAGE and those in tbl_full_list that match)
All the fields draw from tbl_SAGE except for cost_price & stock which come
from tbl_full_list. cost_price uses MIN in the total field to find the
cheapest price. What I need to do is filter out all the "0" stock levels,
however because I'm using totals it seems to ignore the MIN and shows all
matching manu_part_no that <> "0".

What I'm looking to achieve is tbl_SAGE pulls from tbl_full_list the minimum cost_price for the product that matches manu_part_no and the stock quantity (ignoring zero stock). I've tried DLOOKUP as an expression but without a
form to draw from I've been stuck.

This is harder to describe than I thought! Bearing in mind I don't think
i've made myself clear, I'll skip question 2 for now else this'll be a long post!

Would anyone have any advice?

Kind regards,
Michael

Nov 12 '05 #2
Allen

My 'thank you' was lost as I thought I'd sent to group but apparently not.
After posting another message I realised that I was doing it wrong (first
time using Outlook Express for news) so don't think I didn't appreciate your
reply!

Kind regards,
Michael Plant

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:40**********************@freenews.iinet.net.a u...
This should give you what you need. It stacks one query on top of another.

1. Create a query into tbl_full_list price.

2. Depress the Total button on the toolbar (upper sigma icon).
Access adds a Total row to the grid.

3. Drag the ProductID into the output grid.
Accept "Group By" in the Total row.

4. Drag the price field into the grid.
Choose "Min" in the Total row.

5. Drag the quantity field into the grid.
Choose "Where" in the Total row.
In the Criteria for, enter >0

6. Save the query.

7. Create another query into your own price list (tbl_SAGE), your product
list, and the query above. You should have a join between product and the
other two only (i.e. no join between the query and tbl_SAGE).

8. Drag whatever fields you want into the output grid, and base the report
on that.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Michael Plant" <iu*****@hotmail.com> wrote in message
news:10****************@ersa.uk.clara.net...

I'm trying to write my first Access database and I'm getting on well. It's for my own small business use and the scenario is this. I have 4 or 5
suppliers who all email their product pricing and databases daily. As they all use different formats etc, I have linked all their data and import

using
append queries into a single table in a format of my choice. I then
manipulate the data and use it to update my pricing according.

I have 2 problems.

1. Once the pricing has been updated, I want to produce a report showing

me
profit margins as confirmation that I've updated my prices correctly. I'm drawing data from 2 tables, one being my own price table ("tbl_SAGE") and the other being the full list as above ("tbl_full_list"). Because my price is based on the cheapest supplier who happens to have stock, I use a

select
query with the following fields:
product_code; manu_part_no; description; cost_price; sale_price; stock
(I use manu_part_no as the link between tables, showing all in tbl_SAGE

and
those in tbl_full_list that match)
All the fields draw from tbl_SAGE except for cost_price & stock which come from tbl_full_list. cost_price uses MIN in the total field to find the
cheapest price. What I need to do is filter out all the "0" stock levels, however because I'm using totals it seems to ignore the MIN and shows all matching manu_part_no that <> "0".

What I'm looking to achieve is tbl_SAGE pulls from tbl_full_list the

minimum
cost_price for the product that matches manu_part_no and the stock

quantity
(ignoring zero stock). I've tried DLOOKUP as an expression but without a
form to draw from I've been stuck.

This is harder to describe than I thought! Bearing in mind I don't think
i've made myself clear, I'll skip question 2 for now else this'll be a

long
post!

Would anyone have any advice?

Kind regards,
Michael


Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Grant Hammond | last post by:
I assume I'm not alone in my frustration that the expression builder that comes (in part) with Access XP that dosnt wrap text when you open it on an exisitng expression in a query or form. I's...
19
by: Davy | last post by:
Hi all, I am a C/C++/Perl user and want to switch to Python (I found Python is more similar to C). Does Python support robust regular expression like Perl? And Python and Perl's File...
25
by: Mike | last post by:
I have a regular expression (^(.+)(?=\s*).*\1 ) that results in matches. I would like to get what the actual regular expression is. In other words, when I apply ^(.+)(?=\s*).*\1 to " HEART...
2
by: anetasalomonsen | last post by:
I am using xpath within a BizTalk 2006 orchestration. I get the following error "Expression must evaluate to a node-set". My xml: <EmailListResponse xmlns="http://BTTest"> <PersonContact...
9
by: Earl | last post by:
I have somewhat of an interesting scenario: The form allows the user to select a service, which populates a a grid of product information related to that service ("service grid"). The user can...
28
by: Marc Gravell | last post by:
In Linq, you can apparently get a meaningful body from and expression's .ToString(); random question - does anybody know if linq also includes a parser? It just seemed it might be a handy way to...
8
by: Nicodemas | last post by:
Hello all, could not find a regular expression forum, so I thought I would post it to my favorite of the forums. I have a series of applications I've developed which all use a centralized...
18
by: dspfun | last post by:
Hi! The words "expression" and "statement" are often used in C99 and C- textbooks, however, I am not sure of the clear defintion of these words with respect to C. Can somebody provide a sharp...
1
by: Shawn B. | last post by:
Greetings, I'm using a custom WebBrowser control: http://www.codeproject.com/KB/miscctrl/csEXWB.aspx When I get the DocumentSource of a web page I browsed, and run a regular expression...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.