By michelemayaw on 9/1/2019 1:58 PM
Data results that represent money or currency display as unformatted.  In this post I will show how to format the results as currency.

TOOLS:  Microsoft SQL Server Management Studio v17.3; AdventureWorks2008

TASK:  Display unformatted SQL results as currency


The image below shows the unformatted SQL results.


To display the ‘Sales Last Year’ and ‘Sales YTD’ results as currency add the highlighted function to your query.

FORMAT(SalesLastYear, 'C')

FORMAT(SalesYTD , 'C')



By michelemayaw on 11/12/2017 10:19 PM

Whether you are a beginner or experienced writing queries you may receive an error message when you execute a query. 

SQL identifies errors within a query by line number.  Instead of counting through each line it is much more efficient to use the Line numbers option.

TOOLS:  Microsoft SQL Server Management Studio v17.2

TASK:  Select Line numbers option.


Using SQL Server Management Studio from the menu bar select Tools then Options from the dropdown menu.


Writing SQL Queries: Formatting Numbers as Currency
Writing SQL Queries: Display Line Numbers
Welcome To My Blog