.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Query does not display decimal points

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :Sql Server

Hi All,

I have simple query. When I divide a numer in SQL by another number then it does not display the decimal points.

Eg: "Select 60/11" gives me answer as "5"

Eg: "Select cast((60/11) as decimal(5,2))" or "Select CONVERT(decimal(5,2),(60/11))" gives me answer as "5.00"

But, I want the answer as "5.45" and that also on SQL side, because I don't want to handle this on coding side.

Please help!!! Thanks in advance...

View Complete Post

More Related Resource Links

Data Points: Standard Query Operators with LINQ


LINQ to Objects and LINQ to Entities have an arsenal of Standard Query Operators that operate on sequences to perform a wide variety of operations.

John Papa

MSDN Magazine March 2008

Display the Sum of hours and Month Year using sql Query

Hi,  I have,hours(in varchar),Id in table tbl_x ,i need the sum of hours, monthyear(eg. mar 2010)for the last three months.But with two separate queries i am getting these results.but actually i need in the following format   Month/Year      TotalHours-----------------    ----------------Mar 2010            0400Apr 2010             0450-----------------------------------to get month/Year i am using this querySELECT right(convert(varchar, fromdate, 106), 8) from tbl_x where id='11101' for the sum of hours SELECT SUM(CAST(hours AS INT))AS TOTALHRS FROM tbl_x WHERE id='11101'

Display a message if query returns no data


I added a text box to my report reading: "No Data Matches Search Criteria".  I tried to add a visibility expression: =iif((Rownumber("SalesCube")=0),1,0)

I get "The Hidden expression usied...returned a data type that is not valid"

What am I doing wrong???


imagebutton shows "submit query" before image display


hi guys,

i have imagebutton's on a page with width/height's set and the imageurl pulls from a database

anyway theres 20'ish images on the same page so it takes a second or 2 for the images to load, unfortunately with the imagebutton, while it's in that limbo stage there's 20 big ugly grey SUBMIT QUERY textboxes in my face.


anyone know how to wkraround this? some sort of default already loaded image, or somehow to turn that off altogether? 

display sharepoint list Data into content Query Web Part


Hi i have content query web part. now i want to show the sharepoint list data into my content query part

using CQWP setting, i am able to get only one column data but not all.

pls let me know how can i get all list data in different style format 

Need Help in a query... How to Display Last Record For a Given Month


Hi All,

I have a table DBGROWTHTABLE with below structure and data.

USE [ibmdba]


/****** Object: Table [dbo].[DBGROWTHTABLE] Script Date: 10/22/2010 11:54:02 ******/








	[TableEntryID] [int] IDENTITY(1,1) NOT NULL,

	[EntryDate] [smalldatetime] NOT NULL,

	[MachineName] [varchar](100) NULL,

	[InstanceName] [varchar](100) NULL,

	[DBNAME] [varchar](100) NULL,

	[DBsizeMB] [bigint] NULL,

	[unallocMB] [bigint] NULL,

	[reservedMB] [bigint] NULL,

	[dataMB] [bigint] NULL,

	[indexMB] [bigint] 



Hello Friends,

I have a table name : STUDENT in MS-SQL


ID                                 NAME                                 RANK
1                                     A                                     FIRST
2                                     B           &

Edit/Display of Report/Properties/Parameters only 2 decimal places show need 4 decimal places


Does anyone know if there is a way to display 4 decimal places on an Overide Default of data type Float on the Report/Properties/Parameters page.  It accepts 4 decimals and that is what is used in report but when returning to this screen it only displays 2 decimals.

SSRS 2005

CAML Query for display Top n records in sharepoint 2010


Hi friends,

I have added the Content Query web part in my publishing page for displaying data from list.

Now i want to use additional filter option from content query web part.

pls tell me wht query i should write for returning Top n Records from list.

also pls tell me whole caml query format dat i need to put in custom value or query option in additional filter option in Content Query Web Part

MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

GridView inline Master/Detail record display

This code drop is part of a smash and grab series. If you're in a rush, you can just grab this code and insert it into your application, no understanding is required. When you have some time (ya, right) you may want to review the source code.

Display data in gridview dynamicallay

I have AD domain which has 100000 users, I want to display all the users in gridview controls.Actually it is displaying users in gridview after parsing entire domain which takes around 30 min. I want to display the users while loading itself.It is continously getting user information from AD domain and getting each user details, I want to display the users information which already queried instead of waiting till getting all users information

asp.net display data in gridview

i want to display data in gridview binded to a sql datasource
but the problem part is i want to bind a field of that datasource to a dropdownlist and when a item is selected in that dropdownlist then correcposnding to that data will be displayed in gridview...

display data into GridView from excel sheet

I have to display data from excel sheet into my gridview and also I need to figure out a way to store data into excel files from my web page. I am using C# 3.5, VS 2008.

Display Related Data in an ASP.NET GridView

Typically when you display a datagrid you will want to show data from a related table. There are 3 different ways to accomplish this with NetTiers. You can use a custom stored procedure, deepload functionality from the code behind, or a strongly typed datasource control. We'll provide an example of each

How to Encrypt Query String Parameters in ASP.NET

Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend