Format in SQL

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?
 
M

Marshall Barton

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.
 
T

Tim Ferguson

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
 

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