Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MS SQL Server & have generously sponsored dedicated servers and web hosting to ensure a reliable and scalable dedicated hosting solution for

Format Number With Thousands Separator? 10000 --&&> 10,000


I would like to select a BIGINT type and get a formatted result with commas.  Anyone have ideas?
declare @i bigint
set @i = 123456789
select @i
--Would like to get

View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
How To Select Amt With Thousand Separator Format?
Can you tell me the query for selecting the amount with thousand separator format?

for example : select 1234.678 is need to show the output line 1,234.68

View Replies !   View Related
Format Numbers As Rounded To Thousands With Hundreds As A Decimal
I'm putting together a profit and loss report in SSRS. I need to *display* a number, e.g. 1023488.06, as 1,023.5. I've gotten as far as putting #,#,;(#,#,);- in the format property of the relevant textboxes. This yields 1,024.
I don't want to do this via dividing by 1000 and rounding, because users of the report will want to export these online reports into Excel and manipulate them. So I need to preserve the dollars and cents. I just want to change the display of the data, not the data.
The following formatting in Excel does the trick, but doesn't work when I use it in the format property of a textbox in SSRS.
#,##0.0, ;(#,##0.0,);- ;

If this isn't possible, please confirm.

View Replies !   View Related
How To Change A Decimal Number To Percent Format Number?
in my sql, i want to change a decimal number to percent format number, just so it is convenient for users. for example there is a decimal number 0.98, i want to change it to 98%, how can i complete it?


View Replies !   View Related
Format A Number For Use As Number In Excel
I want to format a number like "#,##0.00" in order to handle it in Excel as a number (i.e. compute a sum).

Excel is able to show a number in a specail format and still allow to compute with ...

Thanks in advance,


View Replies !   View Related
Format Number
I am doing some simple arithmatic for a query that I am working on. What I have below describes the arithmatic that is taking place withing a portion of the query:

select(o.sales_val/o.qty_sales) as 'Unit_Price', (o.acctng_cost_val/o.qty_sales) as 'Unit_Cost'
from opcsahf as o

The division is correct. My only issue is that the results for 'Unit Price' or 'Unit Cost' may be formatted like example: 4.25000000.

How can I have my nubers show up with only to 2 decimal places instead of all the zeros at teh end?

View Replies !   View Related
Format Number
I need to change a number that looks like 1365 and make it look like 1,365 without any decimal or trailing zeros. Then number can even be a 7 digit number. It seems like the only way I know is the money to varchar conversion using style 1, but this adds trailing zeros and a decimal point. Can anyone help on this



View Replies !   View Related
Format Number
how can I get 1,33 for 12/9

sql server gives 1

View Replies !   View Related
Number Format
In the report Layout, if I right-click a cell that is located in the table details row, click Properties, and select the Format tab, there is an option for the Format code. I click on the little dot-dot-dot icon (...) and it brings up the Choose Format option. The choices are Default, Number, Date, Time, Percentage, and Currency. The format that I am interested in is Number, so I click on Number. Now, it shows '1234' ; '1,234.00' ; '1234' ; '1234.00' ; and finally '1.234123e+003'. The choice that I am looking for (or desire) is something that would show 9,452 and that is it. No decimals, but want the comma. I do not see an option for this. The option '1,234.00' has decimals. The two options '1234' and '1234' appear to not have decimals, but they do not appear to have commas either. Further, what is the difference between the first '1234' and the second '1234'?
*** Also, I have a couple formulas that I have entered. I have tried to change the Number Format for these cells in the table details row and nothing changes. Still the same format.

View Replies !   View Related
Number Format
When setting the format property for a textbox containing a number the first parameter relates to a positive number, the second negative and the third to zero. 

eg #,###; (#,###); 0

Is there a way of also formatting Null values in the same way without writing custom code?

View Replies !   View Related
Number Format

I have number field that I am trying to format.  The number currently shows -7899.99.  I would like it to show (7,899.99) for negative and 7,899.99 for positive.
Any ideas on how to do this? 

View Replies !   View Related
Format Phone Number
Hi Everyone,
   I have a phone number coming from the database coming in the format of 2132563111. How can I do this in sql query213-563-3111
Please let me know if there is any function that does it.

View Replies !   View Related
Format Number On Select
I have a price field that when I query it, it returns the price as"5.0000". What function can I use to return the price as "5.00"?THANKS

View Replies !   View Related
Format Phone Number
How to format phone numbers in sql? in current fields some phone number entered like this:
1 800 7894564
1800blue etc...
I am trying to get into uniform like this:

View Replies !   View Related
Keep Phone Number Format

 I have phone number column in Excel file. The phone number is in this format: 523-349-0212. When this data imported in to SQLServer file, it is not keeping the format, storing it as 5233490212. The data type of this column is varchar. How to keep this format?
Thanks in advance

View Replies !   View Related
Format Date And Number!
Dear Friens,

I'm having some problem to format my date and number fields!! :-(

In my column I have a date in the format 2007-05-28 00:00:00, and I want it to 28-05-2007.


And the field number I have in the format 28377497636.4987 and I need or 28.377.497.636,4987


or ‚¬ 28.377.497.636.4987.


Could you help me?


View Replies !   View Related
Number Are Displayed In The Wrong Format
HiI'm not sure if this is a .net or a SQL issue. My development machine is using SQL 2005 while the live server is SQL2000. I have a smallmoney field in the database for holding a house rent. The following is used to display the contents on the page<asp:Label ID="lblrent" runat="server" Text='<%# Bind("rent", "(0:0.00)") %>'></asp:Label>In development, the number is displayed correctly, with the decimal place, .e.g. 200.50 but on the live server the number is displayed as 20050,00. What I have noticed in the database is that the number is held differentlySQL 2005 - 200.5000SQL 2000 - 20050Is there a difference between SQL 2000 and 2005? How do I get around this problem?

View Replies !   View Related
Auto-Number Format Problem
I have an autonumber in the format /100, which displays the first entry as 101 2nd as 102 and so on,

When i come to retrieve the data and display it on an aspx webpage it displays the values as 1,2,3,4 etc....

Is this an access thing or should i ask in the .net section?

many thanks

View Replies !   View Related
How To Format The Phone Number In The Result?
like (###) ###-####.

I know that

SELECT phone
FROM author

however, the results will be like

408 496-7223.

but I do not know how to format the phone number.

can you help me to figure it out please?


View Replies !   View Related
Changing The Number Format In SQL Query

I have query
SELECT  col1, a.Inv_Amount as Amount
FROM SPS_Oustandings a
I can get the result values for example as 12345.67 as result, but i need it in german format with , used as decimal point and . as thousand seperator
i need output as 12.345,67 
My DataGrid (ASP.NET) is directly bound to SP which have this query, i want to show amount in above format in grid.
Please Help,

View Replies !   View Related
Format The Number In Matrix's Subtotal
It looks like by default the subtotal number inherits the number format from the main column. Is there a way to override it?
In my case I am displaying percents with a decimal point in a column and sometimes the total comes out to 99.9% instead of 100%. I just want to round of the total to alway show 100%.
Is there a way to do it?


View Replies !   View Related
Number Format While Representing Two Different Field

    I need to represent two different (number) fields in the same textbox ,  one number format is C0 (Currency) and other one is Percentage(P1), how can i keep this number format applicable to appropriate fields?
for exaple this is the expression to represent the two fiels in one textbox.

=Fields!Amount01.Value & vbCrLf & Fields!Amount01Percentage.Value
Thanks in advance.

View Replies !   View Related
How To Find 'x' Number Of Days From 'yyyymmdd' Format?
I need to find out the count of number of records older than 100 days from a table having 'order_date' as yyyymmdd format eg. 20041115. Thanks in advance.

View Replies !   View Related
How To Convert Number Into Fixed Format String.
I would like to convert a number into fixed format string. Say for example if I have number 5, I would like to show it as four charactered string:


In case if I have 33, then I would like to have a result like '0033'. Please let me know the string functions with which I can acheive this.

View Replies !   View Related
Format Money MS SQL Field Data As Number With Commas And No Decimals
If I pull a value from a MSSQL field with is defined as money, how can I get it to display in a textbox with commas and NO decimals?
87000.0000 = 87,000
I can currently remove the decimals like below but is there a way to add the commas as well?
decRevenue = drMyData("Revenue")
txtRevenue.Text = decRevenue.ToString("f0")
It current shows "87000".

View Replies !   View Related
Displaying Extra Characters With COLUMN-defined Number Format?
Here's a tricky SQL question that has definitely driven me to the end ofmy rope. I'm using Oracle 9i and I need to perform some simplemultiplication on a field and then display it with a percent sign usingthe COLUMN command. Here's the code thus far:COLUMN price format 9,999.99 HEADING 'Charged%'SELECT pricecharged * .231 as priceFROM VT_examdetailThe output from this reads:Charged%---------23.1034.6534.65....The kicker here is that I need to add a percent sign to the right of theoutput, so that it reads:Charged%---------23.10%34.65%34.65%....I thought I could do this by just adding "|| ('%')" into the SELECTstatement, but when I do this the decimal position defined in the COLUMNcommand is lost. Does anyone know another way around this?Thanks,Alex

View Replies !   View Related
Incorrect Host-column Number Found In BCP Format-file
Hi guys, would appreciate if you can shed some light on this.Sorry to be a pain, can you tell me what is wrong with the following:for /F %%i in ('dir /b /on c:cppc*.txt') do bcp Inventory..pc in%%i -fc:cpcp.fmt -T -S CHICKYywhere CHICKYy is the serverbcp.fmt8.00.19461 SQLCHAR 0 20 ", " 0 filler_1 ""2 SQLCHAR 0 8 "
" 1 computer_name ""3 SQLCHAR 0 20 ", " 0 filler_2 ""4 SQLCHAR 0 16 "
" 2 ip_address ""5 SQLCHAR 0 20 ", " 0 filler_3 ""6 SQLCHAR 0 60 "
" 3 operating_system ""pc1.txt and other *.txt format is:JW_193801,,Windows XP,when I run it I get:C:cp>for /F %i in ('dir /b /on c:cppc*.txt') do bcp Inventory..pc in%i -fc:cpcp.fmt -T -S CHICKYyC:cp>bcp Inventory..pc in pc1.txt -fc:cpcp.fmt -T -S CHICKYySQLState = S1000, NativeError = 0Error = [Microsoft][ODBC SQL Server Driver]Incorrect host-column numberfound in BCP format-fileC:cp>bcp Inventory..pc in pc2.txt -fc:cpcp.fmt -T -S CHICKYySQLState = S1000, NativeError = 0Error = [Microsoft][ODBC SQL Server Driver]Incorrect host-column numberfound in BCP format-fileC:cp>bcp Inventory..pc in pc3.txt -fc:cpcp.fmt -T -S CHICKYySQLState = S1000, NativeError = 0Error = [Microsoft][ODBC SQL Server Driver]Incorrect host-column numberfound in BCP format-fileC:cp>bcp Inventory..pc in pc4.txt -fc:cpcp.fmt -T -S CHICKYySQLState = S1000, NativeError = 0Error = [Microsoft][ODBC SQL Server Driver]Incorrect host-column numberfound in BCP format-fileC:cp>bcp Inventory..pc in pc5.txt -fc:cpcp.fmt -T -S CHICKYySQLState = S1000, NativeError = 0Error = [Microsoft][ODBC SQL Server Driver]Incorrect host-column numberfound in BCP format-fileThe sql table has 3 columns:Sorry to be a pain.-----------------------------------------------------------------------"Are you still wasting your time with spam?...There is a solution!"Protected by GIANT Company's Spam InspectorThe most powerful anti-spam software available.

View Replies !   View Related
Conditional Number Format On Specific Matrix Column Group
I'll try to make this simple. I'm on SSRS 2005 and I have a report with a matrix object that has one row group and one column group. I need to switch the number format only for values where the column group has a specific value.
For example, here are the records in the table:
Customer, Type, Amount
Customer1, Revenue, -100
Customer2, Cost, 60
Customer1, Revenue, -200
Customer2, Cost, 125
By default the matrix object shows the following (the total comes from the standard subtotal on the column group):
                     Revenue         Cost           Total
Customer1          -100             60             -40
Customer2          -200            125            -75
But the users need the report to look like this, with all positives (why, oh why?!  ):
                     Revenue         Cost           Total
Customer1          100             60              40
Customer2          200            125             75

I was able to use the inscope function to switch the signs of the Total numbers. But now I need to switch the signs of the Revenue column from negative to positive (and vice versa), without affecting the signs of the Cost column. It's strange to me because I CAN switch the signs for a specific row group (changing Customer1's number format, without affecting Customer2's format) using something like this:
=iif(Fields!Customer.Value = "Customer1", "($#,###.#0); $#,###.#0", "$#,###.#0; ($#,###.#0)")
But a similar expression specifying a column group value does not work, because the report seemingly doesn't recognize the value of the column group at all no matter what I do:
=iif(Fields!Type.Value = "Revenue", "($#,###.#0); $#,###.#0", "$#,###.#0; ($#,###.#0)")
The other reason why this is strange is that I've done drill-through reports off of matrix objects where specific column group values (the ones clicked on) can be passed into the drill-through report parameters. So it recognizes the column group values upon drill-through, but not for formatting?
How else can I do this? I must be missing something here. Thanks.

View Replies !   View Related
Counting Occurrence Of A Value &&amp; How To Format For Fixed Number Of Rows &&amp; Columns

I need to count and display the number of records which have GradeTitle="SHO". I'm only starting to use BI development studio and all attempts at using the built in aggregate functions have failed.

Also, the report I wish to create has a fixed number of columns and a fixed number of rows as the info being displayed is really only counting values in the DB. I tried using Table but multiple rows were created.

I'd appreciate if anyone could point me in the right direction, as searching this forum turned out to be pretty fruitless for me.

Thanks in advance,

View Replies !   View Related
Textbox - Number Format Leads To Mysterious Leading Bracket
A report is picking up some values from the body and displaying them in text boxes within the Page Header, via the ReportItems collection. The text boxes within the body have their format specified as #,###; (#,###) - so displaying negative values within brackets. If the following value is set for the Page Header text box:

="My Value" & " " & ReportItems!variance.Value
the value displayed is, for example:
(My Value (1,123
Hence the requested trailing bracket has been swapped to become a leading bracket. Whatever I've tried I cannot get the bracket in the correct place. Am I missing something obvious or is this a bug?

View Replies !   View Related
How To Return Time && Number Format That Has Set In The Regional Setting Using Stored Procedure
How to return time & number format that has set in the regional setting using stored procedure.
Following is my sp for getting current date format from Sql Server.

View Replies !   View Related
ADO: Locale And Decimal Separator
I am working on an application that uses ADO to retrieve data from SQL Server 2005. It may be used against various instances of databases and each instance contains floating point values that may used comma (',') or point ('.') as decimal. This is where the problem occurs. Depending on the database instance the strings containing floating point values also use comma or point as decimal separator.
Is there a way that by which I can force the database to return floating points with decimals separated by point? Doing a prelimimary google search, I found hints of including "Locale Identifier" in the connection string such as

Code Block
Provider=SQLOLEDB.1;Persist Security Info=True;Locale Identifier=0x0409;User ID......

but even if I specify US English locale, it does not remove the commas in floating point data.
Kind regards
Jens Ivar

View Replies !   View Related
How Can I Use Comma Like A Decimal Separator?
"update product set price='1,99' where cod='001'"

I need COMMA... not DOT

In oracle i use "alter session set language='Brazil'"... but... in SQL SERVER???

View Replies !   View Related
How To Add A Line/separator Between Groups?

I have a simple report with multiple grouping. I like to add a separator between groups.

Some data (Group #1)

=================  <----- separator line or color row or something

Some data (Group #2)




View Replies !   View Related
How Can I Use Comma Like A Decimal Separator?
"update product set price='1,99' where cod='001'"

I need COMMA... not DOT

In oracle i use "alter session set language='Brazil'"... but... in SQL SERVER???

i need help...

View Replies !   View Related
Decimal Separator With Comma... Is Possible???
In Sql Server Express

I need use in field MONEY

"update product set price='1,23' where cod='001'"

i don´t use

"update product set price='1.23' where cod='001'"



View Replies !   View Related
SQLCODE -10000 (10k)
Having this sql=-10000 on this statement below, which referes to some mismatch between columns and host-vars.
This runs from MicroFocus program against SQLServer'05 table, all hosts are well defined, same picture.
Interesting thing is that if I change ws-volume for literal, eg.
B3M_VOLUME = 21 it will work fine, but doesn't work with B3M_VOLUME = :WS-VOLUME:



also anybody can point to good place to see list of all sql codes:

Tx all

View Replies !   View Related
Thousands Databases ?

i just started working on a new project, a RIA with a backend on SQL 2005.
The question that I'm asking - about the databases architecture - is it possible:
a) (this is the preferred solution) to have up to 5 000 (five thousands) databases inside a SQL 2005 instance (each client with his own small db)
b) would it be better to have one large database with tables eventually having near a billion of rows ?
c) one single database with thousands of small tables.
Thank You All.

Edit :
The clients databases will be identical in structure.
The motivaion for having each client with his own database is to ease management (backups, restores, roll-backs) and tools in this direction will be created (scripts, automated procedures, scheduled management plans etc). Each client is proprietary, and to have things separated seems more legal.
The hardware is not a problem, the db server will be a blade center runing a clustered MS Windows Server.

Code Snippet

(07:51:49) him: i haven't followed sql recently but let me see (seems difficult question)
(07:52:36) him: what is the motivation to have different datbases for each client?
(07:52:46) me: (the hardware is not a problem, probably ibm blade center, about the management - tools will be created to ease)
(07:52:52) him: it is it the size/efficiency or you want to separate them
(07:53:02) me: for the back-ups and restores and roll-backs
(07:53:13) me: the db-s r identical
(07:53:30) him: identical in design or data inside them
(07:53:33) me: yes, design
(08:02:12) him: so the limitation is Databases per instance of SQL Server 32,767
(08:02:21) him: so it seems that in that respect you are going to be fine
(08:02:45) me: yes, i've seen the specs
(08:02:50) him: yep
(08:03:03) him: in terms of design
(08:03:13) him: managing 5000 databases would be a nightmare
(08:03:22) him: unless there is some automatic way to do it
(08:04:18) me: that's for shure, and that's what is intented
(08:04:29) me: automadet procedures, scripts etc
(08:05:27) him: so again what is the motivation to partition each client in different database
(08:06:05) me: there is a need to keep their data separate
(08:06:19) me: each client is proprietary
(08:06:44) me: and to have things separated is more legal
(08:07:25) him: well you try with several databases and see how it scales
(08:08:37) him: one thing that would also prevent confusing databases connections and may be helpful if you decide to change the to a single database model is to design the database as if it would be used with many clients but use it just for one
(08:09:09) him: then, if you decide to merge the databases in the future it would be relatively easy
(08:09:16) him: unless this would create too much overhead
(08:09:41) me: yes, this is allready the case
(08:09:58) me: so, i go for a test u say
(08:10:12) me: and see how it's working
(08:10:16) him: ok. then it seems that the issue is maintaince then anything else
(08:10:29) him: yeah. i don't think the sql server would be a problem
(08:10:44) him: there would be some overhead of the different databases but should be small
(08:11:12) me: :)
(08:11:24) me: k, thank you verry much
(08:12:53) him:
(08:13:09) him: i think either way has plus and minuses
(08:16:56) him: also read the forum link i sent you
(08:17:00) me: ty, i'm on it
(08:17:16) him: there are some interesting considerations i did not think of
(08:17:58) me: i just saw about caching maintainance plans, stored procs

View Replies !   View Related
Update 10000 Fields
I have a list of 10000 websites that need to be updated with certain data.

So my question is would i be able to get SQL to lookup a certain list of websites? And then me update the required fields?

Its prob an easy answer, thanks!

View Replies !   View Related
Logging Thousands Of Errors
I'm receiving these two errors again and again:


Windows cannot load extensible counter DLL MSSQL$MSFW, the first DWORD in data section is the Windows error code.


Windows cannot load extensible counter DLL MSSQL$SBSMONITORING, the first DWORD in data section is the Windows error code.


What might be generating them and how can I cure it?


The system is SBS 2003 R2 Premium.



View Replies !   View Related
How Can I Use Comma Like A Decimal Separator In Sql Server Express?
I need HELP

"update product set price='1,99' where cod='001'"

I need COMMA... not DOT

In oracle i use "alter session set language='Brazil'"... but... in SQL SERVER???


View Replies !   View Related
Slow Query Thousands Of Records.
I have a query that returns raw tick data from a table. Unfortunately aftereven a few days there are hundreds of thousands of rows so the followingquery is not efficient.SELECT * FROM RAWTICKDATA WHERE Status = 'I' AND ContractCode = ? ANDRawTickID = (SELECT Max(RawTickID) FROM RAWTICKDATA WHERE Status = 'I' ANDContractCode = ? AND PRICE =(SELECT Min(Price) FROM RAWTICKDATA WHERE Status= 'I' AND ContractCode = ?))The most obvious solution then is to get all tick data with status ='I'(Imported) for a contract, process it and then move it to another table forarchiving. I am faced with a problem however: After selecting all data for acontract with status='I' the application was updating these records to a newstatus of 'P' (processed). Unfortunately another application is continuningto feed in live data and so it is possible that we will inadvertantly updateunprocessed data to 'P'.Question: Is it possible to select all records with status 'I' (from abovequery) and update their status to 'P' in one sequence?I am not a programmer, but if this is possible I should be able to implementthe query.Many thanks.Steve

View Replies !   View Related
Deleting Thousands Of Rows In A Table
How can I quickly delete thousands of rows in a table (SQL2000) according a query and without blowing up the log file? For instance executing the query:
Delete from transactions
WHERE transactiondatestamp < DATEADD (m,-4,GETDATE())

increases my log file to almost 6GB before job was done an normal size was re-obtained. In addition it took a long to time to get the job done.
With the command truncate table I cannot use query unfortunately but this would be faster.

Anyone has an idea?


View Replies !   View Related
390 Tabels In Database And 10000 Transaction A Day Is It A Lot?
From Sql server point of view 390 tabels in database and 10000 transaction a day is it a lot ?

At what point performance starts slow down ?

View Replies !   View Related
Package Dies After About 10000 Seconds.
I have written a package that archives off old orders over night, it appears that this package is failing after about 10000 second every time it is run. I don't think it is memory as I am running it and checking for memory leaks.

Basic run down of package is

EXEcute SQL task to get orders to delete

If a for loop, loop each ordernumber

within the for loop there are 2 dataflow

dataflow 1

find related records in child tables (oldb connection using query)

using a mutli split first

check (with lookup)  for records already in archive database

only copy on a fail from the look up


delete related records

dataflow 2

do the same but for the parent table


SP1 CTP is installed on server.

Any ideas?



View Replies !   View Related
Exact Datetype Not There In Number Fromat In Format Cells At The Time Of Rendering Ssrs Report Into Excel
i have ssrs report with contains 3 fields like start date, end date, percentage value, for these fields i given date and percentage fromats  in format tab of the textbox, i export this report into excel sheet,
what is problem is , in the excel sheet i select the date or percentage column and select the format cells option and selected the number format,but here i did not seen any  format like date or percenatge  format what ever i given datatype in report and  it shows general format only for all columns.
here i need  solution  like when clicking the number format in format cells it shows defaultly appropriate dateformat like date or  percentage format at the time of rendering into excel.

i think it is bug in ssrs , any guy please help me

View Replies !   View Related
Help Required For Splitting Up String Variable Using Comma Separator
I need a help in SQL Server 2000.
I am having a string variable in the format like -- (1,23,445,5,12)
I need to take single value at a time (like 1 for 1st, 23 for 2nd and so on) from the variable and update the database accordingly. This is like a FOR loop.
Can anyone help me out in splitting the variable using the comma separator...

View Replies !   View Related
Importing Text File Removes Decimal Separator

I'm trying to import a semi-comma separated text file into a SQL db. I have a field in the text file that contains decimal number. As a decimal separator it's used a comma (15,35). When i use a DTS package to create a destination table and import all rows, the field is created as a float field. In this field the decimal comma is removed so the number in SQL becomes 1535. If I change the decimal separator to (.) i works OK. But I need to get it work with comma as decimal separator. In the DTS package the field form the text file is recognised as varchar (8000). Any ideas?



View Replies !   View Related

Copyright © 2005-08, All rights reserved