Solved

Select as money in view

Posted on 2007-04-02
6
172 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
[X]
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
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
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

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

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

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

by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

724 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