SolvedPrivate

Currency format in SSIS

Posted on 2014-07-29
5
25 Views
Last Modified: 2016-02-11
I want to  output columns in a sql table to a text file in SSIS.  The price column is money  
like 9877.21 but  it should look like $      9877.21 in the text file
0
Comment
Question by:Nana Hemaa
  • 2
  • 2
5 Comments
 
LVL 14

Expert Comment

by:Vikas Garg
Comment Utility
Hi,

You can use Derived Column and convert the Money to Varchar and Concatenate it with $ Symbol

Expression will be like this "$ " + (DT_STR,10,1252)MoneyColumn
0
 

Author Comment

by:Nana Hemaa
Comment Utility
getting invalid expression
0
 

Author Comment

by:Nana Hemaa
Comment Utility
run ok but ouput in text file did not change.  I want 5 leading spaces after the $   sign
like $      9877.21 .  I added derived column but still gets 9877.21.   I replaced the column name price in the derived column
0
 
LVL 12

Expert Comment

by:Harish Varghese
Comment Utility
Above solution should work. Post a screenshot of the derived column setup.
0
 
LVL 14

Accepted Solution

by:
Vikas Garg earned 500 total points
Comment Utility
Hi,

Replace for id column will not work since id column in not varchar and the output of derived column is varchar.

and for spaces you can add space near the $ sign

"$     " + (DT_STR,10,1252)id
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

From time to time, for debugging and troubleshooting your flow at run time you’ll need to check if the variable has the correct value or not, there’re several ways to check for the value of the variables inside the flow, You can add Break Points, a …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now