Re: How to find Minimum of four fields



Union queries can only be made in the SQL view.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"galsaba" <galsaba@xxxxxxx> wrote in message
news:1166209065.356610.41530@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


This is BEATIFUL! It works! (although I dont exactly understand what I
did...)
is there a way to do it with "Design View"? or just "SQL View"?

Thanks!

Douglas J. Steele wrote:
Let's assume you currently have a table with Id, Field1, Field2, WebCost,
PhoneCost, StoreCost, and ShowCost.

Create a UNION query along the following lines:

SELECT Id, Field1, Field2, "WebCost" AS CostType, WebCost AS CostAmount
FROM MyTable
UNION
SELECT Id, Field1, Field2, "PhoneCost" AS CostType, PhoneCost AS
CostAmount
FROM MyTable
UNION
SELECT Id, Field1, Field2, "StoreCost" AS CostType, StoreCost AS
CostAmount
FROM MyTable
UNION
SELECT Id, Field1, Field2, "ShowCost" AS CostType, ShowCost AS CostAmount
FROM MyTable

Use that query to populate the properly normalized table.



.