Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query seems simple but I cannot do it

Status
Not open for further replies.

mscolwhite

Technical User
Aug 12, 2004
3
US
I have four fields

revenue| netincome| cost goods sold| selling expense

the user is to choose which of these are volatile or stable

I want my query to select all the fields marked volatile. My query works when I query each separately, but how to I use one query to show which items are "volatile" per category?

example: one query that will provide the following result

revenue | cost of goods sold |Selling expense
volatile| volatile |volatile
 
Could you clear up your syntax so that your question is easier to understand? Fields are not "marked". Fields have "values". Also, there really aren't "items". I assume you mean "records".

You showed the result of a query. Is this the result you want? What are some sample records and the final result you expect. Please take the time to type in some samples to help us understand.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
I'm not sure if this is what you are talking about - but have you tried using the "or" property of the query.

example:

SELECT YOURTABLENAME.revenue, YOURTABLENAME.cogs, YOURTABLENAME.sellingexpenses
FROM YOURTABLENAME
WHERE (((YOURTABLENAME.revenue)="VOLATILE")) OR (((YOURTABLENAME.cogs)="VOLATILE")) OR (((YOURTABLENAME.sellingexpenses)="VOLATILE"));

Hope that helps.
 
I apologize for my ambiguity. I'll try to clarify.

I have 4 fields they are revenue, cost of goods sold, selling expense, and net income. Users can only select between two values they are stable and volatile.

My goal is to create a one query that will retrieve values that equal "volatile" across all four fields. I tried the or feature, but it is also retrieving "stable" values.


 
Then try this:

SELECT revenue,cogs,sellingexpenses, netincome
FROM YOURTABLENAME
WHERE ( revenue='VOLATILE' AND netincome='VOLATILE' AND cogs='VOLATILE' AND sellingexpenses='VOLATILE');

-VJ
 
If the values for all four fields in a record must be "volatile" then enter "volatile" in the same row of the criteria under each of the four fields.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
I also have difficulty understanding the question. Is this your meaning:

You have a table with four fields. You want to display the records. When the user views an individual record, he will mark each field as "volatile" or "stable".

If that is correct, you may need eight fields not four. The design would resemble this:

field1A text
field1B yes/no

field2A text
field2B yes/no

field3A text
field3B yes/no

field4A text
field4B yes/no
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top