I am getting my source data from another system am storing the SaleAmount of each product in a field the data type of which is [decimal](12, 2).
For some products I am getting an exact match (upto 2 decimal places) as compared with my source data BUT for some other products the value before the decimal places is correct but the 2 digits after the decimal place does not match with the source data :confused:
Even if this sounds stupid, can you please guide me. Am i missing some very basic and common sense thing?
How to search a string from the given values. i want to search a string "Session" from the given column of results.. it is separator by comma. i want only 2 results from the given value... if i'm writing as like keyword it will return 4 but i need only the exact match of string.. _______________________ The Result should be Session,Study Patterns, session, asp.net _______________________ But the Result is coming as Session study, usercontrol Session, study Technical Session, Asp.net Patterns, session, asp.net ________________________ anyone tell the solution
books catalog, education, best books Birthday, Party Gopi Session study, usercontrol Session, study Holiday Technical Session, Asp.net Patterns, session, asp.net day, party events for Lords, daily thing events manager events things meeting, administrator marriage project ,event, demo madurai ,event demo, event calendar rangoli, event Demo Project event project
Hi can anybody give me a simple example to check exact match word using sql sever Ex: my word is like this : welcome to sql sever2005 Now i want to find server how it is possible? I tried like this select * from test where content like %server% . but is gives me possible result. But i dont want like this if i have an exact match with that key word then only i want possitive result. Actually there is no word with server, i'm having only server2005 . So how can I get it?
I have a very basic Lookup in my SSIS package that looks up against two columns and outputs a row to a table. Now currently if there is no exact match, it writes a null in my destination table. How do I simply drop all those rows that dont produce an exact match? I tried using the 'Ignore' error output, but with that it writes NULLS into my destination table. With the 'Redirect' it is looking for a place to redirect the error (NULL) rows, and I dont want to deal with the hassle or writing these NULL values to a file or table just to delete them afterwards. I just simply want to forget about all those rows that dont produce an exact hit and only fill in the destination table with those that do produce a hit. How can I drop these lookup rows that dont produce an exact match?
Could anyone help of how to match the exact characters in a data field in SQL 2005 Developer. For example, if one has a password "GooD", then when he or she enters "GOOD", "good", etc, the database will not match the password. And he or she must enter the exact characters, which is "GooD". Thanks.
Could anyone help of how to match the exact characters in a data field in SQL 2005 Developer. For example, if one has a password "GooD", then when he or she enters "GOOD", "good", etc, the database will not match the password. And he or she must enter the exact characters, which is "GooD". Thanks.
Hi, I am trying to get my string to 2 decimal places... Here is the code:string sumSQL = "SELECT CONVERT (float,sum(callTime)/count(callTime)) as CAVG FROM leads where agent = '" + agent + "' and " + dates.Text; SqlCommand sumCMD = new SqlCommand(sumSQL, conn2); object null1 = sumCMD.ExecuteScalar();if (null1 != null) {string avgS = sumCMD.ExecuteScalar().ToString();Response.Write(avgS + "<br>" + "</td></tr><tr>"); }
I have many columns of data. They are all using the money datatype. When Ienter a value into a column such as 32.00, it only shows up as 32. Whenoutputted to an ASP page using a query it also only displays 32. If thedata is 32.33, then the display is 32.33. How do I get it to display 32.00?Thanks!DarrenMCP
Hello, I have a datatable with a column of decimal numbers 0 - 1. I want to move the decimal 2 places to the right to make the column a percent column. I don't know how to do that. Thanks Steve
I am new to SQL 7, and am having trouble with the money and smallmoney data-types. When I pull data from these columns, it has four decimal places, and I need only two (four is screwing the perl code up). What do I do now?
The underlying table for my fact contains a Sale field whose data type is decimal.
In the cube editor, I have tried a few options (both for Data Type and Display format) but in my front-end I am still getting the results with 2 decimal places.
Can someone kindly help me how I can get the results in a rounded form so that the decimal places are not shown e.g. instead of seeing 12,345,678.98 I want the results rounded as 12,345,679.
If (and i really hope not) it boils down to using MDX in the front end then can u kindly guide me since I can only spell MDX at the moment :(
I am trying work out if certain columns in a database table have the "correct" data in them and work out the "percentage completeness" of the data...
So, I have been allocating a 1 if the data is complete and a 0 if it's not. Then adding up the results and dividing them by the number of results and multiplying them by 100 to get a percentage.
BUT - the answer always comes back as a whole number and I cannot work our why!
This is my sql:
SELECT Clients.ClientNumber_Legacy, CASE WHEN Client_Details_Enhanced.ClientType_Code = 'NK' THEN 0 ELSE 1 END, CASE WHEN Client_Details_Enhanced.Title_Code = 'NK' THEN 0 ELSE 1 END, (CASE WHEN Client_Details_Enhanced.ClientType_Code = 'NK' THEN 0 ELSE 1 END) + (CASE WHEN Client_Details_Enhanced.Title_Code = 'NK' THEN 0 ELSE 1 END) as total,
There's been several good posts on using the node description of a model as the end user description for a specific cluster. My model uses a number of continuous input columns defined as currency from a fact table in the source cube. After processing, the node description has elements that look like this:
-0.5799759795 <=Interest Expense <=0.8397462488 ,
Since the source data is currency, this makes the node description look a little strange. The data type in the model is set as double. The precision implied by the description is not what I want the model to consider. In the case above, the difference between the numbers listed is not significant.
It would be great to have a better node desciption that doesn't imply so much precision, but the bigger question is why does the cluster model turn currency types into doubles. Should I set the data type to long in the model so that cents are ignored? I know I should probably use discrete inputs, but I don't want to have to discretize the currency values in the cube since this would require me to set up fact dimensions for each currency column in the fact table.
Hello, is there a way to convert the value to just 2 decimal places, I created the report in Reporting Services and it has quite a few digits to each value. I looked at the table and found that the data type is {Float}. Is there a way to convert the values to just 2 decimal places?..Thank You.
Hi, i need to display my data in 2 decimal places but now i'm getting results after some calculation (for eg. 2.336224). How can i round it off to 2.34?
Dim subtot As Double Dim tax As Double Dim tot As Double subtot = "0.00" Dim sql As String sql = "SELECT items.qty, products.descrip, products.price FROM items INNER JOIN products ON items.productid = products.id WHERE (items.orderid = " & Request.QueryString("oid") & ")"Dim objConn As New SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|AllStar.mdf;Integrated Security=True;User Instance=True") Dim cmdCustomers As New SqlCommand(sql, objConn)Dim dataReader As SqlDataReader objConn.Open() dataReader = cmdCustomers.ExecuteReader(CommandBehavior.CloseConnection)While dataReader.Read subtot = subtot + (dataReader.GetValue(0) * dataReader.GetValue(2)) End While tax = (subtot * 0.07) tot = (subtot + tax) Label1.Text = subtot Label2.Text = tax Label3.Text = tot ---------------------------------------- How to a convert the variable tax to just two decimals? I tried label2.text = CType(tax, Double) but that didn't work either Thanks in advance
Hi. I have a query that returns several averages and percentages. Is there some way to set up the query so the results only go to 2 decimal places? Here is a sample of the query I am using: Code:
$query = "SELECT COUNT(deal_id), SUM(vs), SUM(vs)/COUNT(deal_id)*100, AVG(fin) FROM sales GROUP BY salesperson";
It works great,except the results are several decimal places long, and I need it to be only 2.
I have a table with a money field that had previously been running calculation and storing the data into the database's money field. Since this field supports 4 decimal places, it was storing 4 decimal places worth of data. I have since cleaned up my insert routine to round everything up to two decimal places and it only inserts the rounded values. I now have to go back and update the old data with the two decimal place rule. How would I go about doing this?
Hey - I have a quick question and know that it is probably pretty simple, but I am stumped. I have a query where I need to make a colum a number that looks like a percent with 2 significant digits:
i.e., SELECT tblNumericCovert.number1, tblNumericCovert.number2, [number1]/[number2] AS testDiv FROM tblNumericCovert
where testDiv needs to spit out results like this ###.##
I am totally lost, if anyone can help, I would appreciate it.
I have an SQL search that is converting two values to type money. I want it to show two digits after the decimal point but am getting inconsistent results. The first value is as follows:
tblInventoryItem.itemcost as originalcost (the column is datatype money)
This displays correctly i.e. 2000.00 or 150.70 etc
The second value is this:
tblInventoryItem.itemcost + tblUpgrades.ItemCost as totalcostincupgr (both columns are datatype money)
But this displays as 2000 or 150.7
How can I get the second value to show two decimal places even when the digits are zeros?
I have a field in a database which is a datatype Money. When I run a select query the data is coming back with 4 decimal places like 100.0000 but I only want 2 decimal places like 100.00.
Hello, The issue is to convert a number like 114270 to 114 + (270/320) = 114.84375. The decimal version is the desired result. In other words the last 3 digits of 114270 are in base 320.
Question: I cast my number as char() then use substring() to get the digits. Then I cast back to float and divide by 320. I get 0 when I do this and I'm not sure why.
Code follows: declare @p float set @p = (select top 1 P from [tablename] where Product = 'Z')
declare @pchar as char(6) set @pchar = cast(@price as char(6)) declare @first3 as char(3) declare @second3 as char(3) set @first3 = cast(substring(@pchar, 1,3) as float(25)) set @second3 = cast(substring(@pchar, 4,6) as float(25)) select @pchar -- 114270 select @first3 -- 114 select @second3/320 -- 0
I have tried changing cast(substring(@pchar, 4,6) as float(25)) to cast(substring(@pchar, 4,6) as decimal) and I get the same result. Any suggestions or is there a better way altogether?
I need to format a field to a set number of decimal places which is held as a field within the DB, and also format it as a standard number.
I have been able to set the format of the field to the decimal places field and it all works (the quantity in the row has the right number of decimal places), but i cant now format it as a number...
Heres an example:
The quantity is 1500 with 3 decimal places so it becomes 1500.000
I need to format it as a number with comma's etc such as 1,500.000
How would i go about doing this? Ive already used the format option for the decimal places and dont know how to add another format type (which in this case will be N)