Formatting data in a query

  • Thread starter Thread starter MikeShipp
  • Start date Start date
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")
 
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.
 
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)
 
Back
Top