Select as money in view

Posted on 2007-04-02
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?

Question by:lrbrister
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
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?

Author Comment

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?
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?
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.


Author Comment

ID: 18839322
Merged Word doc field:    «ListPrice»

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

Accepted Solution

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

Author Comment

ID: 18847379
Sorry for not getting back sooner.  Points being awarded now

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

756 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