Formatting A Column Display With Dollar Sign
Feb 24, 2014How to implement the display of a dollar sign for an output in a query...
View 5 RepliesHow to implement the display of a dollar sign for an output in a query...
View 5 RepliesCode:
objrs.Open "Select * from [klcc_f$]", objConn, adOpenStatic
why IM getting dollar sign is not a valid name ?
I have a query where I have to use the convert function to return the unitprice as a decimal with 2 digits to the right of the decimal and a $ to the left of the number like 10 should be $10.0o. How do i insert the $. this is my code so far:
SELECT CONVERT(varchar, UnitPrice, 1) AS varchartotal
FROM dbo.[Order Details]
In Crystal Reports, there was a "reverse sign for display" property that could be checked for a number box. This was used for debits and credits (and such) so a negative number would be displayed as a positive and a positive displayed as a negative.
How would this work, or is there something simple, in Reporting Services?
Thanks for the information.
Hello
I'm struggling with this one.......!!
I need to format a VARCHAR field storing a date value in to a different format.
The field currently holds date data in the format 01/01/2008 but I want to return 010108.
The nearest i'm coming out with is 01012008 by using the REPLACE function, but can't seem to get out the required format.
It is not a date field and I can't change it to a date field, due to other procedures relying on it.
Can anyone help??
Thank you
Does anyone know how to set the interactive display to default to "Page Width" as opposed to "100%?" Several of my reports are stuggling for real estate, and I'd like to be able to scale the interactive report to fit any resolution. A bit elementary I suppose...but clients have a need. Thanks in advance.
hobbz
I'm looking for a new way to publish reports based on OLAP data and was very disappointed to find that Reporting Services does not natively support displaying MDX query results in a matrix. While it is possible to assign an MDX query to the matrix control in Reporting Services, the two main problems are that the columns of the query must be measures (not dimensions), and it does not support display of server based formatting (fore color, back color, and font flags).
Does anyone know of any custom control that properly deals with Analysis Services data?
Thanks for any info you have!
Is there a way to display a column alias as part of the result set column labels?
View 9 Replies View RelatedHi Everyone,
I am trying to hide a column in a matrix table. I have no trouble using conditional formatting to control the visibility of the column, but when I hide the column the main row in the matrix does not shrink. Therefore, I have a big gap€¦ My thought was to use conditional formatting to control the column width of the main matrix row. Listed below is the expression that I used. Can anyone help me with the error message or recommend a better solution?
=IIF(Fields!FiscalYear.Value = IIF(Month(TODAY()) = 10-12,Year(TODAY()) ,Year(Today())-1), 0.625in, 0.25in) cannot be parsed as a unit because it does not contain numeric values. Examples of valid unit strings are "1pt" and ".5in".
Regards,
A.Akin
Hi there --I'm writing a SQL query that works something like this:SELECT a, b, a/b AS col_name FROM TABLEDividing a by b can result in a value above or below 1, e.g. 1.234 or 0.123.If the value is below 1, I don't want the preceding zero, e.g. .123.I've been using a STR() function to format it to three decimal points, e.g.:STR(a/b, 5, 3) AS col_name.... but for values below 1 it'll look like 0.123.Any suggestions for how I can make this look like .123?Thanks in advance.
View 5 Replies View RelatedI have a column of phone numbers that have formatting such as (xxx)xxx-xxxx,
or xxx.xxx.xxxx or xxx.xxx-xxxx; however, not all phone numbers are formatted in this fashion. I need to remove all characters and only leave behind numeric digits to look like xxxxxxxxxx. I have tried select replace(colname,'-','') from table. This does the trick but does not actually change the values in the column. Any help in accomplishing this would be helpful. Thanks in advance.
Paul
What is the equivalent SSIS expression for this C expression to format an unsigned integer by padding it with leading zeros?
sprintf(publ_doc_id, "%010u", id)
Part of my query is :
SELECT * FROM TableA
WHERE ColumnA >= DATEADD(DAY, - 30, GETDATE())
With the expression at the where clause above, you can pull a rolling 30 days data without having to supply values. Now users of the report want to see it represented like: 2nd April – 1st May
when the report is ran. the requirement is not to use a parameter for the reportKnowing that I have no parameters, how do I reference ">= DATEADD (DAY, - 30, GETDATE())" to reflect the start date and the end date in the report?
I am using this query to get the nearest value and rounding it.
floor(Price*DollarPrice) as Dollars
This returns result like below
31
34
567
Now I just need to add dollar symbol before the result.
Hello Everyone,
Does anyone know where I can go to get the format to make
$ right align + =Sum(Fields!Blah.Blah) as #,###.00?
|------------------------------|
|$ 23.00|
|$ 1,000.00|
|------------------------------|
I can not figure out how to get the dollars to right align like Excel ?
Please point me to the answer or a previous post that answers this...
I was wondering what is the best way to have a amount paid total from amounts entered to a specific id or column? I am using SQL 2005. I need to be able to tally the total amount paid and put that value in another column called amount paid. Any help would be great.
Thanks,
I am JOINing a Table with a View, and the View can have multiple rows relating to the join condition(i.e. My view as 4 columns, and can look like the following:
A B C D
A E F G
B H I J
I want this to look like -
A B C D E F G
B H I J
I want one row, but not one column, I need to maintain each value in its own column, withinin a single row.
Doesn't matter to me if that transition happens in my View or as the outcome of my Join.
I've been looking at the PIVOT command, but that appears to only work with an aggrgrate function. I don't want to calculate/aggreagte anything, just combine my multiple rows in one.
This is my VIEW stmt -
SELECT [PKG ID] AS PKG_ID, [APPR GRP NAME], [USRID OF APPR], [APPR STATUS]FROM dbo.pkgapproversWHERE ([APPR STATUS] = 'approved') AND ([APPR GRP TYPE] = 'E')
This is my Join stmt - set @sql = N'SELECT DISTINCT [PKG ID] AS PKG_ID, [ELM ACT] AS Action, [END EXEC DATE] AS "Exec Date", [COMMENT] AS Comment, [USRID OF APPR]
FROM [PkgAction]
FULL JOIN vw_PkgApprovals
ON PkgAction.[PKG ID] = vw_PkgApprovals.[PKG_ID]
WHERE 1=1'
Any thoughts....Thanks
Hi,
I want to display data that is 10 as $10.00 or 10.1 as $10.10..
and i tried giving this expression
=IIf(Fields!Nav.Value = "n/a","n/a",(cstr(Format(Fields!Nav.Value,"C2"))))
But when i run the report its giving it as C2 and not $10.00 or whatever it should be.
any help will be appreciated.
Regards
Karen
Generally, what would be a good start to model and make predictions based on the following.
Even Dollar Transactions €“ Including transactions that end in $0 or $50 with a Total Transaction Amount between $400 and $5000.
I have a table called Transaction with a BillingAmount column.
I've gone through the SQL Server 2005 Data Mining Tutorial (which uses a discrete prediction BikeBuyer yes or no) and read a lot of Data Mining with SQL Server 2005. Neither of these give good, complete, methodical examples of selecting inputs and targets and making predictions; especially for continuous columns.
I think I'm generally struggling with the concepts of selecting (continuous?) predictable attributes and calculating predictions based on the results. Are there any examples of a scenario similar to the above that I can reference? or just some advise.
Hi,
1. This is what SET NOCOUNT ON does:
-- SET NOCOUNT to ON and no longer display the count message.
SET NOCOUNT ON
GO
SELECT au_lname
FROM authors
GO
2. Now, is it possible and what is the statement to use if I don't want to display
the header column? au_lname. Thanks.
I have a date column and a value column. I want to display the value column based on the last date. MAX (Date)
I tried using MAX for the date column but that displays the last date.
Any Ideas?
Hello!
I am wracking my brain, trying to figure out how to return & display a column's description.
I work in Cold Fusion with SQL 2000 database.
My table name is "clients" and the column in question is "client_firstname"
The description of this column, as entered in Ent. Mgr, is "First Name"
If anyone can please help me, it would be very greatly appreciated!
Thanks!
Now for the details...
I am trying this:
----------------------------------------------------------------
<cfquery name="get_ext2" datasource="#application.dsn#">
SELECT
objname As 'Column'
, value As 'Description'
FROM
::fn_listextendedproperty
('MS_Description', 'user', 'dbo', 'table','client', 'client_firstname', default)
</cfquery>
<cfoutput>
"#get_ext2.Column#"
"#get_ext2.Description#"
</cfoutput>
----------------------------------------------------------------
... and it is returning this:
"" ""
In my debug output, the query result appears as such:
----------------------------------------------------------------
get_ext2 (Records=0, Time=16ms)
SQL =
SELECT
objname As 'Column'
, value As 'Description'
FROM
::fn_listextendedproperty
('MS_Description', 'user', 'dbo', 'table','client', 'client_firstname', default)
----------------------------------------------------------------
Haaalp!
Thanks....
Richard
Would like to know if it is possiblefor any of you to suggest how to conditionally diaplay a Column based on the values of the other columns.
Here's my query
SELECT
[ProductionDay]
,DATEPART(wk,StartTime) AS WeekCount
,(AVG([RNTDuration])) AS AvgRNT
,MIN([RNTDuration]) As LeastRNT
,MAX([RNTDuration]) As WorstRNT
,dbo.fn_MinimumRNT_sp([ProgramNo],[Machine],[ProductionDay]) AS BestRNT
,dbo.fn_MinimumRNT(SubAssemblyNo,[Machine]) AS BestRNT_txt
,SUM([LoadingDuration]) AS LoadingTime
,[ProgramNo] AS ProgramNo
,COUNT(RNTID) AS PartsCount
,[SubAssemblyNo]
,[Sheetsize]
FROM [RPMS].[dbo].[List_MachineShopRNT]
where Machine = @iMachine and dateadd(month, datediff(month, 0, [StartTime]),0) = @dtMonthStartDate
Group by DATEPART(wk,StartTime), [ProductionDay],[Machine],[ProgramNo],[SubAssemblyNo],[Sheetsize]
Here I would like to Run the function dbo.fn_MinimumRNT_sp or dbo.fn_MinimumRNT if the ProgramNo is 100
Thank you
Query for output this result on Table C ?
========================================================
I have one table store below information, and other one table is store staff name and phone number. how to display of table c data by new column and using the key staff_code1=staff_id or staff_code2= staff_id or staff_code3=staff_id ?
---------------------------------------------------------
Table A
staff_code1,staff_code2,staff_code3
Table B
staff name
staff_id
staff_phone
-----------------------------------------------
Table C display in new column .
staff name-1 code1 staff name-2 code2 , staff name-3 code3
peter id-01 susuan id-03 david id-05
I have this easy sql for a drop down.
select code_value, desc1
from dbo.market_area_code
where code_value in ('1', '2', '4')
How can I add something to display something like
if code_value = '1' then display 'Blue'
if code_value = '2' then display 'Orange'
if code_value = '4' then display 'Red'
How do I count the number of positive dollar values in a query? I have various negative and positive dollar values and want to count how many positive I have then I will know how many are negative. I cannot put >0 or >0.00 in the where because it still returns everything cuz the programmer set the datatype to be money
View 4 Replies View RelatedHai
I have amount field in my table as decimal. I need a query to display the amount with dollar or euro symbol based on country selection. The country also in same table.
For example If country is US then Amount $1200, If country is UK then Amount €1200.
Thanks in advance.
GridView_1
Category Name SubCategory Name Amount
Construction Construction 2,877.00
Design Design 0.00
Soft Cost Inspection 0.00
GridView_2
Category Name SubCategory Name Amount
Construction Construction 2,800.00
Construction Contingency 300.00
Design Design 500.00
Soft Cost Inspection 980.00
Soft Cost Survey 145.00
Soft Cost Testing 720.00
Soft Cost Management 1000.00
Soft Cost Other Costs 10,000.00
QUESTION:
How could I UNION the two result sets together and where the Category Name and SubCategory Name are equal for GridView1 and GridView2, show the difference in the Amount column.
This is the result I am looking for.
Category Name SubCategory Name DIFFERANCE
Construction Construction 77.00 = (GridView1 - GridView2)
Construction Contingency 300.00
Design Design 500.00
Soft Cost Inspection 980.00
Soft Cost Survey 145.00
Soft Cost Testing 720.00
Soft Cost Management 1000.00
Soft Cost Other Costs 10,000.00
I am trying to do it on the back end. Though, if you have a clever way to produce a resulting gridview in C# with the results I need, I am all game!
This is what I have so far: (TSQL code)
SELECT
tblCategories.txtCategoryName,
tblSubCategories.txtSubCategoryName,
tblEstimatesLineItems.curEscAmount
FROM
tblEstimatesLineItems, tblCategories, tblSubCategories
WHERE
tblEstimatesLineItems.lngzEstimateId = 24 AND --@lngzEstimateId_Compare1
tblEstimatesLineItems.lngzCategoryId = tblCategories.idsCategoryId AND
tblEstimatesLineitems.lngzSubCategoryId = tblSubCategories.idsSubCategoryId
union all
SELECT
tblCategories.txtCategoryName,
tblSubCategories.txtSubCategoryName,
tblEstimatesLineItems.curEscAmount
FROM
tblEstimatesLineItems, tblCategories, tblSubCategories
WHERE
tblEstimatesLineItems.lngzEstimateId = 25 AND --@lngzEstimateId_Compare1
tblEstimatesLineItems.lngzCategoryId = tblCategories.idsCategoryId AND
tblEstimatesLineitems.lngzSubCategoryId = tblSubCategories.idsSubCategoryId
Hi,I have a DataGrid whose DataSource is an SQLDataSource. This SQLDataSource references a SQL Server table with an Identity column, named Id. The SQLDataSource has generated an Update statement for me, but this only works if the Id column is selected for display in the DataGrid, and has Visible = True. If not, then the @original_Id parameter to the generated Update statement has a value of Nothing, and the Update has no effect. So is there a way to enable the Update statement to work, without the user having to see the Id column in the DataGrid? Many thanks,Keith.
View 3 Replies View RelatedMy first ASP.NET/SQL project. I'm creating an Asset Management DB. I wish to view the Asset number, the full name of the user it's assigned to and the Make and Model of each record in the DB. However assets are split into different categories e.g. monitors, PCs, Preinters etc. and they are all in different tables. The SQL below displays the asset number, Name of person assigned and the model of the asset.
SELECT Hardware.AssetNo, [User].FullName, MonitorModel.Model, PCModel.Model AS Expr1, PrinterModel.Model AS Expr2
FROM Hardware INNER JOIN
[User] ON Hardware.UserID = [User].UserID INNER JOIN
Model ON Hardware.ModelID = Model.ModelID LEFT OUTER JOIN
MonitorModel ON Model.MonitorModelID = MonitorModel.MonitorModelID LEFT OUTER JOIN
PCModel ON Model.PCModelID = PCModel.PCModelID LEFT OUTER JOIN
PrinterModel ON Model.PrinterModelID = PrinterModel.PrinterModelID
This outputs:-
Asset number FullName Model Expr1 Expr2
00000 User Name Model NULL NULL
00001 User Name NULL Model NULL
00002 User Name NULL NULL Model
However what i hope to acheive is output Model, Expr1, Expr2 into one column like so:-
Asset number FullName Model
00000 User Name Model
Can i do this in the SQL or do i have to do it in my ASP.NET (VB) Page?
Using VSWD 2005 Ex Edition and SQL Server 2005 Ex Edition
Thank you for your replies
I am trying to display component usage in January for the past year, if I want to display the year in different column, what should I do?
eg.
component_id component_description qty_used_on_2005_Jan qty_used_on_2006_Jan
C58B0BDD tape drive 2 3
Currently I am using this sql:
select cast(year(date_complete) as varchar(10)) + ' Jan' as Year, component_id, component_description,sum(component_qty) as total_qty_used
from view_jobComponent
where month(date_complete) = 1group by component_id, component_description, cast(year(date_complete) as varchar(10)) + ' Jan'order by component_id, component_description
which I will get something like this:
Year component_id component_description total_qty_used
2005 Jan C58B0BDD tape drive 22006 Jan C58B0BDD tape drive 3
I have a column in the following select startement called displayvalue. Displayvalue is a varchar column. Primary everything entered into this column is numeric, but there are times when NR is entered. In the select query if it sees NR, I would like to have NR changed in the resultset to NULL or blank. NR doesn't come up all of the time, but I have not idea how to do this in the select statment.
Here goes..
SELECT SAMPLE.SAMPLEID, SAMPLE.U_WORKORDERNUMBER, SAMPLE.U_SAMPLEDATETIME, SDI.PARAMID, SDI.DISPLAYVALUE
FROM SAMPLE SAMPLE, SDIDATAITEM SDI
WHERE ( (SAMPLE.SAMPLEID = SDI.KEYID1) AND
(SAMPLE.U_WORKORDERNUMBER = '0060') AND (SAMPLE.U_SAMPLEDATETIME > '31-DEC-2003') AND (SDI.PARAMID = 'BOD') )
ORDER BY SAMPLE.SAMPLEID ASC, SDI.PARAMID ASC
How do I only display a part of data from the column ?
Lets say emp_id is E3456 and all i want to display is 3456 without that E?