Format Union Query

bknight
BronzeLounger
Posts: 1391
Joined: 08 Jul 2016, 18:53

Format Union Query

Post by bknight »

I have a Db that has a union query. The numbers are formatted double in the table. When the union query is run the values displayed are double. How may I format those numbers to currency? I found out that the union queries have the property sheet greyed out.

User avatar
HansV
Administrator
Posts: 78512
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Format Union Query

Post by HansV »

You can apply currency format to any text box bound to that field on a form or report. There is no need to format it in the query.
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1391
Joined: 08 Jul 2016, 18:53

Re: Format Union Query

Post by bknight »

I knew you would say that.

User avatar
HansV
Administrator
Posts: 78512
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Format Union Query

Post by HansV »

So why ask the question? :grin:
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1391
Joined: 08 Jul 2016, 18:53

Re: Format Union Query

Post by bknight »

OK small issue with the union

Code: Select all

SELECT Hourly,  CountOfProfit, SumOfProfit
FROM [quThreeOclocktrades]
union all
SELECT Hourly,  CountOfProfit, SumOfProfit
FROM [quFourOclocktrades]
union all
...
Here is a portion of the union. What I intended is to sum all the hourly data, but what I have displays all of them. What changes do I need to make for the union to sum all the different hourly data?

User avatar
HansV
Administrator
Posts: 78512
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Format Union Query

Post by HansV »

If I understand your question correctly, create a new query based on the union query that sums the data.
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1391
Joined: 08 Jul 2016, 18:53

Re: Format Union Query

Post by bknight »

A normal query, I guess.
Yes that worked. Thanks