I'm new to SQL Query Analyzer, but not SQL itself. I've looked in the help
files for the proper way to format a value in the output of my query, but
can't find it. The keyword FORMAT is acceptable, but I can't get the rest o
f
the syntax.
My query is like this:
Select count(*), sum(average balances) as average balances format="$#,##0"
from whatever
group by ...
Where does the format syntax belong? Thanks for the help.There's no FORMAT function in SQL Server. The reason FORMAT is a key word is
because it is used on
the BACKUP command. I strongly suggest you do formatting in the client appli
cation. Let SQL Server
return data and have the client app present the data.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Mark1" <Mark1@.discussions.microsoft.com> wrote in message
news:EF22A6CA-6210-4BA2-98F1-C5B643E71F85@.microsoft.com...
> I'm new to SQL Query Analyzer, but not SQL itself. I've looked in the hel
p
> files for the proper way to format a value in the output of my query, but
> can't find it. The keyword FORMAT is acceptable, but I can't get the rest
of
> the syntax.
> My query is like this:
> Select count(*), sum(average balances) as average balances format="$#,##0"
> from whatever
> group by ...
> Where does the format syntax belong? Thanks for the help.|||Do you know of any good reference books that I can purchase to help me answe
r
questions like this?
"Tibor Karaszi" wrote:
> There's no FORMAT function in SQL Server. The reason FORMAT is a key word
is because it is used on
> the BACKUP command. I strongly suggest you do formatting in the client app
lication. Let SQL Server
> return data and have the client app present the data.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Mark1" <Mark1@.discussions.microsoft.com> wrote in message
> news:EF22A6CA-6210-4BA2-98F1-C5B643E71F85@.microsoft.com...
>|||Hi,
SQL Server Books online will be a veruy good resource to veryfy syntax.
Thanks
Hari
SQL Server MVP
"Mark1" <Mark1@.discussions.microsoft.com> wrote in message
news:E4F30BDC-376F-4EF6-9532-6812070683FE@.microsoft.com...[vbcol=seagreen]
> Do you know of any good reference books that I can purchase to help me
> answer
> questions like this?
> "Tibor Karaszi" wrote:
>
Showing posts with label helpfiles. Show all posts
Showing posts with label helpfiles. Show all posts
Sunday, February 19, 2012
Format
I'm new to SQL Query Analyzer, but not SQL itself. I've looked in the help
files for the proper way to format a value in the output of my query, but
can't find it. The keyword FORMAT is acceptable, but I can't get the rest of
the syntax.
My query is like this:
Select count(*), sum(average balances) as average balances format="$#,##0"
from whatever
group by ...
Where does the format syntax belong? Thanks for the help.
There's no FORMAT function in SQL Server. The reason FORMAT is a key word is because it is used on
the BACKUP command. I strongly suggest you do formatting in the client application. Let SQL Server
return data and have the client app present the data.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Mark1" <Mark1@.discussions.microsoft.com> wrote in message
news:EF22A6CA-6210-4BA2-98F1-C5B643E71F85@.microsoft.com...
> I'm new to SQL Query Analyzer, but not SQL itself. I've looked in the help
> files for the proper way to format a value in the output of my query, but
> can't find it. The keyword FORMAT is acceptable, but I can't get the rest of
> the syntax.
> My query is like this:
> Select count(*), sum(average balances) as average balances format="$#,##0"
> from whatever
> group by ...
> Where does the format syntax belong? Thanks for the help.
|||Do you know of any good reference books that I can purchase to help me answer
questions like this?
"Tibor Karaszi" wrote:
> There's no FORMAT function in SQL Server. The reason FORMAT is a key word is because it is used on
> the BACKUP command. I strongly suggest you do formatting in the client application. Let SQL Server
> return data and have the client app present the data.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Mark1" <Mark1@.discussions.microsoft.com> wrote in message
> news:EF22A6CA-6210-4BA2-98F1-C5B643E71F85@.microsoft.com...
>
|||Hi,
SQL Server Books online will be a veruy good resource to veryfy syntax.
Thanks
Hari
SQL Server MVP
"Mark1" <Mark1@.discussions.microsoft.com> wrote in message
news:E4F30BDC-376F-4EF6-9532-6812070683FE@.microsoft.com...[vbcol=seagreen]
> Do you know of any good reference books that I can purchase to help me
> answer
> questions like this?
> "Tibor Karaszi" wrote:
files for the proper way to format a value in the output of my query, but
can't find it. The keyword FORMAT is acceptable, but I can't get the rest of
the syntax.
My query is like this:
Select count(*), sum(average balances) as average balances format="$#,##0"
from whatever
group by ...
Where does the format syntax belong? Thanks for the help.
There's no FORMAT function in SQL Server. The reason FORMAT is a key word is because it is used on
the BACKUP command. I strongly suggest you do formatting in the client application. Let SQL Server
return data and have the client app present the data.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Mark1" <Mark1@.discussions.microsoft.com> wrote in message
news:EF22A6CA-6210-4BA2-98F1-C5B643E71F85@.microsoft.com...
> I'm new to SQL Query Analyzer, but not SQL itself. I've looked in the help
> files for the proper way to format a value in the output of my query, but
> can't find it. The keyword FORMAT is acceptable, but I can't get the rest of
> the syntax.
> My query is like this:
> Select count(*), sum(average balances) as average balances format="$#,##0"
> from whatever
> group by ...
> Where does the format syntax belong? Thanks for the help.
|||Do you know of any good reference books that I can purchase to help me answer
questions like this?
"Tibor Karaszi" wrote:
> There's no FORMAT function in SQL Server. The reason FORMAT is a key word is because it is used on
> the BACKUP command. I strongly suggest you do formatting in the client application. Let SQL Server
> return data and have the client app present the data.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Mark1" <Mark1@.discussions.microsoft.com> wrote in message
> news:EF22A6CA-6210-4BA2-98F1-C5B643E71F85@.microsoft.com...
>
|||Hi,
SQL Server Books online will be a veruy good resource to veryfy syntax.
Thanks
Hari
SQL Server MVP
"Mark1" <Mark1@.discussions.microsoft.com> wrote in message
news:E4F30BDC-376F-4EF6-9532-6812070683FE@.microsoft.com...[vbcol=seagreen]
> Do you know of any good reference books that I can purchase to help me
> answer
> questions like this?
> "Tibor Karaszi" wrote:
Subscribe to:
Posts (Atom)