Solved

Select as money in view

Posted on 2007-04-02
6
169 Views
Last Modified: 2010-03-19
Have a view in SQL that is going into a merged MS Word document.

Is there a way to format a field as money in the view?

0
Comment
Question by:lrbrister
  • 3
  • 3
6 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18839243
money can be part of a view with no problem, so what is your exact problem?
0
 

Author Comment

by:lrbrister
ID: 18839295
The sql database field is a varchar and I need the merged document to have the currency formatting.

Is there a convert I can plase in the view?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18839310
can you post samples of what data the field has, and what you want it to have as output?
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:lrbrister
ID: 18839322
Merged Word doc field:    «ListPrice»

Output is                        1222000
Want                             $1,222,000
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 18839347
please try this:
select replace ( convert ( varchar(10) , cast ( cast ( ListPrice as int ) as money ,  1 ) , '.00' , '' ) as ListPrice
from yourtable
0
 

Author Comment

by:lrbrister
ID: 18847379
angelIII:
Sorry for not getting back sooner.  Points being awarded now
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question