Formatting data in a Union Query

  • Thread starter Thread starter D Glenn
  • Start date Start date
D

D Glenn

I used a union query to bring together data from 10
queries. One of the fields is set to be Fixed with 8
decimal places in all 10 queries. The union works but the
format of the field changes to scientific notation. How
can I change it to fixed 8? Below is my code.
Thanks
Dave

SELECT [Fund],[Divergence],[Classes] FROM
[qryDivergence1vs2]
UNION SELECT [Fund],[Divergence],[Classes] FROM
[qryDivergence1vs3]
UNION SELECT [Fund],[Divergence],[Classes] FROM
[qryDivergence1vs7]
UNION SELECT [Fund],[Divergence],[Classes] FROM
[qryDivergence1vs8]
UNION SELECT [Fund],[Divergence],[Classes] FROM
[qryDivergence2vs3]
UNION SELECT [Fund],[Divergence],[Classes] FROM
[qryDivergence2vs7]
UNION SELECT [Fund],[Divergence],[Classes] FROM
[qryDivergence2vs8]
UNION SELECT [Fund],[Divergence],[Classes] FROM
[qryDivergence3vs7]
UNION SELECT [Fund],[Divergence],[Classes] FROM
[qryDivergence3vs8]
UNION SELECT [Fund],[Divergence],[Classes] FROM
[qryDivergence7vs8]
UNION SELECT [Fund],[Divergence],[Classes] FROM
[qryDivergence3vs8];
 
How
can I change it to fixed 8?

Create a Form (for onscreen) or Report (for printing) and format the
textbox in which the field is to be displayed. Query datasheets are
VERY limited.

If you really need to use the datasheet, use the Format() function to
convert the number to a text string for display:

ELECT [Fund],Format([Divergence], "#.00000000"),[Classes] FROM
[qryDivergence1vs2]
UNION SELECT [Fund],Format([Divergence], "#.00000000"),[Classes] FROM
[qryDivergence1vs3]

etc.
 
Back
Top