Format in SQL

  • Thread starter Thread starter LisaB
  • Start date Start date
L

LisaB

In need to be able to determine (format) the output of the Average function.
Currently the output is ##.0 I need it to show the value out to the second
decimal point (##.00)

How do I do this in SQL

In VBA I can use the format function to format the output of the average
function like this

Format(Avg(MyValue),"###.00")

When I Use this format in SQL I get "Format is not a recognized function
name" error

What is the correct syntax to be used in SQL?
 
LisaB said:
In need to be able to determine (format) the output of the Average function.
Currently the output is ##.0 I need it to show the value out to the second
decimal point (##.00)

How do I do this in SQL

In VBA I can use the format function to format the output of the average
function like this

Format(Avg(MyValue),"###.00")

When I Use this format in SQL I get "Format is not a recognized function
name" error

What is the correct syntax to be used in SQL?

That is the correct syntax! I sounds like you may have a
references problem. If one of the references is Missing or
not the correct version, then items in any library may fail.
 
Format(Avg(MyValue),"###.00")

When I Use this format in SQL I get "Format is not a recognized function
name" error

This certainly should work with a Jet database, but probably not with SQL
Server or other servers. Where are the data you are querying?

Tim F
 
Back
Top