Formatting data in a query

M

MikeShipp

I have the following total calculation in a query. It
formats the data properly but does not right justify it.
Does anybody know the code to right justify the data
created from a query?

TotalYr: Format(Sum([Per01]+[Per02]+[Per03]+[Per04]+[Per05]
+[Per06]+[Per07]+[Per08]+[Per09]+[Per10]+[Per11]+[Per12]+
[Per13]),"$0,000")
 
J

John Spencer (MVP)

When you use the Format Function, it turns the results into a STRING. In a
query, strings are Left-justified and there is no way that I know of to change
the justification of a column in a query.

I you are using the Access Query grid, you might be able to use the FORMAT
property of the column to set the display format. If you do that then the value
will not be converted to a number.

You could NOT format the output of the query, and use the format property of a
control on a form or report to do this.
 
V

Van T. Dinh

Try removing the Format() function from the expression and
use the Format Property of the (calculated) Field in the
DesignView of the Query.

HTH
Van T. Dinh
MVP (Access)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top