I want to display only the current culture currency symbol in rdlc report textbox. Is there a Keyword? - rdlc

I could ot find any keywords that will get me the currency symbol.Help will b greatly appreciated.

Left(FormatCurrency(0,0),1) gives the currency symbol

Related

Issue with the change of the column precision to be 2 decimal places

I need to change the % sales vs forecast column precision to be 2 decimal places instead of whole numbers. The confusing part is that I already have a format function and 'Po' as a '%" at the end, so I am trying to understand how I can make a % with two decimal points keeping this '%' sign in the field as well.
My formula:
FORMAT((f.TOTHIST - f.TOTFCST) / f.TOTFCST, 'P0') AS 'Sales VS FCST'
How I have now
If someone can help me how to adjust it and make it for example in the result as 48.88% instead of 49% that would be great!
Thank you!!
This format works fine:
SELECT FORMAT((f.TOTHIST - f.TOTFCST) / f.TOTFCST,'#,##0.00%')

Oracle Sum with $ symbol

I am trying to sum the field which has a $ symbol next to the number. I am using the below code but I get an "Invalid Number" error.
This field is already a VARCHAR2 type.
SELECT FILER_CD,P ORT_ENT_CD, ENT_TYP_CD,
TO_CHAR(Sum(VAL_AMT),'$9,999,999.99') AS SUM_AMT
FROM AMT_TABLE
GROUP BY FILER_CD, PORT_ENT_CD, ENT_TYP_CD, VAL_AMT;
If column contains $, remove it.
sum(replace(val_amt, '$', '')) as sum_amt
If column is formatted differently (group and/or decimal symbols), you'll have to fix that as well because you can't sum strings. Sample data might help us help you.

How to add $ symbol to the value field in the pentaho report designer

I have field which is taking string as datatype and that field has values like $20000 and N/A. I am using the string as datatype I want to show data like this $20000 and N/A, but I am getting it as a 20000 and N/A. How can I get data as $20000 and N/A. I am using that expression:
=IF([annual_roll_amount]=="N/A";"N/A";"$" &[annual_roll_amount])
What is wrong in this expression and Is it ok to use that in value field under attributes??
Your expression is wrong.
you have to use CONCATENATION.
=IF([annual_roll_amount]=="N/A";"N/A";CONCATENATE("$";[annual_roll_amount]))

Error Converting data type Discount amount vs fixed amount

Good day
This is the code I am using and it gives an error "Error converting data type varchar to numeric"
select InvPrice.StockCode, InvPrice.SellingPrice,
SorContractPrice.StartDate, SorContractPrice.ExpiryDate, SorContractPrice.PriceMethod, SorContractPrice.FixedPrice, SorContractPrice.Discount1,InvPrice.SellingPrice
From InvPrice
Inner Join
SorContractPrice
on SorContractPrice.StockCode = InvPrice.StockCode
where SorContractPrice.PriceMethod IN
(case when SorContractPrice.PriceMethod = 'F' then SorContractPrice.FixedPrice
when SorContractPrice.PriceMethod = 'D' then InvPrice.SellingPrice - SorContractPrice.Discount1
else SorContractPrice.FixedPrice
end)
I need to deduct the discount from the fixed price alternatively it should stay as the fixed price.
Sorry I am very new to sql
Your assistance is highly appreciated.
You can use try_convert on one of the items that you are going to use to minus off. convert method works too. [If the first item doesn't work, you can try it on the alternate one. But if you already know which one holds the varchar value, then use it on that one.] You can basically convert both of them to the same value (float or numeric)
If you need a short guide on how to use those , here it is : http://sqlhints.com/2013/06/08/try_convert-sql-server-2012-built-in-conversion-function/
But remember that it will not convert it for you if it simply cant. If it can't it just means that the data you are using for varchar most likely isn't a number ,etc.
Also, what #KD commented, cast also helps too.
Hope this helps you out.

Basic SQL query

I am just beginning an SQL class and am having issues with one of the problems I must do.
The question is
Use the IN operator to list the part number and part description of each part in item class AP or SG.
What I have for the answer is
SELECT PART_NUM, DESCRIPTION
FROM PART
WHERE CLASS IN (AP, SG);
If I try to run that it states that SG is an invalid identifier. But if I view the table there are classes that = both ap and sg. does anyone have any assistance as to what I am doing incorrectly? Thanks for your time
if class is an attribute of type varchar2 o varchar you should run sql like this
SELECT PART_NUM, DESCRIPTION
FROM PART
WHERE CLASS IN ('AP', 'SG');
Notice that putting a ' on each element
Quote the values 'AP','SG' as they are chars.
... in ('AP','SG')
I think you're just missing quotes - try:
WHERE CLASS IN ('AP', 'SG');
Only int values can be written without quotes for char and varchar datatypes, you need to use quotes and hence the values AP and SG must be provided in quotes like below :
SELECT PART_NUM, DESCRIPTION
FROM PART
WHERE CLASS IN ('AP','SG');