.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

sql 2008 convert nvarchar to float

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :Sql Server
Hi i need to write a condition in my query where my column value is greater than 2 my column name is sales..and when ever the value in sales in greater then 2 i should get  the O/P but datatype of my  column sales is "nvarchar"  i have used the condition cast(isnull(sales,0) as float)>2, but this didnt work. if some one could help me ...

View Complete Post

More Related Resource Links

is it possible to convert whole visual studio 2008 web site project to visual studio 2010 web site p


is it possible to convert whole visual studio 2008 web site project to visual studio 2010 web site project


my current project references




i have a very annoying iis problem

iis server stops working until app pool is recycled


i am hoping that new visual studio (net framework 4.0) may solve this very annoying unsolveable problem


Crystal Report vs 2003 convert to vs 2008 parameter problem


Hi friend,

I have a project develop with Visual Studio 2003, when i convert the project to Visual Studio 2005 is work well. But when i convert to Visual Studio 2008, the crystal report when have pass parameter will prompt the parameter field to re-type then show the report.

But in this converted project i create a new report and pass the parameter is ok. That means i wan re-do all report @.@??

Does someone can help me solve this problem??

Thank you

Convert 2005 RDLC to 2008 using VS2010


Hi and thanks.


I'm getting an error on serveral reports that I built  in VWD2005 (express) using the reportviewer control.  Trying to edit the rdlc file in VS2010, VS2010 asks if i want to convert the file to RDLC 2008 format and I click ok.  When I build the site, I get this error (and of course also when the report is ran):


Error 1 The report definition is not valid.  Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' which cannot be upgraded. C:\inetpub\wwwroot\mastercardlcm\Reports\WorkLists\OpenSRStatus.rdlc 1 


Here is my web.config concerning the RDLC assemblies, etc.

			<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
		<compilation debug="true">
				<add assembly="Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
				<add assembly="Microsof

Convert float to String

HI, I am creating a derived column in my workflow. This derived column would have a concatenated value or Currency + [Account No]. Derived column is of type DT_STR. Currency is string (which is fine). I am having trouble converting [Account No] from float to string I tried Currency + (DT_WSTR)[Account No] and Currency + (DT_STR)[Account No] I am a newbie here... so, excuse my stupid question

Convert string to float

Hi, Sorry for posting this here. Wasnt getting enough attention in "Getting Started With SQL" forum.   I have a column MTD_PNL of type varchar(255) that may have NULL as a value along with numerical values. I want to write an sql to sum up MTD_PNL grouped by ACCT_NO   SELECT ACCT_NO,  SUM(Convert(FLOAT, ISNULL(MTD_PNL,'0.0'))) AS SUM_MTD_PNL GROUP BY ACCT_NO   The above SQL fails when encounters NULL.

convert string to float when NULL

Hi, I have a column MTD_PNL of type varchar(255) that may have NULL as a value along with numerical values. I want to write an sql to sum up MTD_PNL grouped by ACCT_NO   SELECT ACCT_NO,  SUM(Convert(FLOAT, ISNULL(MTD_PNL,0.0))) AS SUM_MTD_PNL GROUP BY ACCT_NO   The above SQL fails when encounters NULL.  

convert any string to float

hi friends, i am struggling to convert simple string to float here. It is not very simple. I've database which is free text in the front end so people can enter any result. it should be numeric. It can be 0.1 or 3,4 or 33,,22 or 22.2 or 4.5 i can handle all combination when covert into float but when it comes to 3,4 or 22,,33 then it is difficult to conver into float. When i use isnumeric in where clause then it thinks 3,4 is numeric and then it cant convert that text into float. any suggestion? Thanks.

how to convert web application to website in visual studio 2008

Dear all,                      I have to integrate web application into website. What are the changes i have to do. I need information very urgently. can any one help here. 

Convert NVARCHAR column to DateTime - SQL Server


Hi there,

Have spent few hours to get this working. I like to get help now. Please note MONTH AND DATES stored in single or double digits as they occur.

Unfortunately DATE TIME is stored in NVARCHAR Data type column as 2/9/2010,  22/10/2010 etc. Following UK Date here.

It is required to pull the data to COUNT No. of Expired. Obviously below one fails.

--AS Date AND Month stored in Single digits AND double digits , below statement 
--thorws Arthmetic overflow exception
SUM(CASE WHEN CONVERT(DATETIME,ExpiryDate,103) >= (CONVERT(datetime,'2010-01-07',103)) AND    
 CONVERT(DATETIME,ExpiryDate,103) < dateadd(month,1,(convert(datetime,'2010-01-09', 103))) THEN 1 ELSE 0 END) AS Expired  


Convert NVARCHAR column data into DATETIME - SQL Server 2000


ExpiryDate column in Table Data Type is NVARCHAR , storing Dates ONLY without time as 2/10/2010 , 12/10/2010 IN DD/MM/YYYY FORMAT.



SUM(CASE WHEN CONVERT(datetime,a.expirydate,103) >= (CONVERT(datetime,'2010-01-07',103)) AND 
		CONVERT(DATETIME,a.ExpiryDate,103) < dateadd(month,1,(convert(datetime,'2010-01-09', 103))) THEN 1 ELSE 0 END) AS Expired


Your help is greatly appreciated. Spent hours to get this resolved.


Convert NVarchar to DateTime - SQL Server 2000


Hi there,


Using SQL Server 2000.

ALTER PROCEDURE [dbo].[CountUsers]
			@startMonth nvarchar(20) =	NULL,
			@startYear nvarchar(20) = NULL,
			@endMonth  nvarchar(20) = NULL,
			@endYear  nvarchar(20) = NULL,
			@startDate nvarchar(50) = NULL,
			@endDate  nvarchar(50) = NULL

		SET @startDate = @startYear + '-01-' + @startMonth; 
		SET @endDate  = @endYear + '-01-' + 

How do I convert UTC to specified time zone in T-SQL (SQL Server 2008 R2)?


Question: How do I convert UTC time to specified time zone using SQL in SQL Server 2008 R2?


Scenario: I have a database/ASP.NET application that I use to manage people from quite a few different time zones. In order to keep activities coordinated, all the times in the database are UTC time. Each user's TimeZone is also registered in the database using .NET Framework time zoneIDs e.g. Eastern Standard Time.

In my query I want to specify a date and pull all the activities for that date. However, because all time stamps are UTC times, sometimes an individual's activies fall on two consecutive days in UTC time zone even though the individual completed them on the same day in his/her time zone. As a result, I get misleading data.

When I specify a date, I want that date to be considered user's date. That means, I need to convert all the activity time stamps into user's time zone in my query. This is where I can use some help.

Thanks, Sam

How to convert a column of "Apr 14 2004 12:00AM" nvarchar format to "14-Apr-2004" nvarchar format in


I have couple columns with "Apr 14 2004 12:00AM" nvarchar format in a table. I need to convert to "14-Apr-2004" nvarchar format. How can I do that? These are not in datetime format, and I have to get the 12:00am timing out of the column. There are many columns with many rows of data. Hope someone give me some idea, thanks!

Using Conditional Split data Transfer in SSIS 2008

This article uses the Integration Services Conditional Split Data Transformation element to filter and transfer data from a set of flat text files to SQL Server database table. The concept can be easily extended to apply to any other source or destination such as Microsoft Excel. This scenario is useful in creating denormalized database tables in a reporting and analysis situation.

Sql Server 2008 Tutorials

This Link Provides total Sql Server 2008 Tutorials

Seven reasons to care about SQL Server 2008 R2

Microsoft begins to fully realize its vision of SQL Server as an information platform and not "just" a database. Hence the main theme for this release -- at least according to Microsoft -- is self-service BI. The PowerPivot plug-ins for Excel 2010 and SharePoint 2010 are easily going to make the biggest splash of all the new features, not least because they're the most complete. But then, SQL Server 2008 R2 isn't strictly necessary for PowerPivot for Excel, which works with plenty of other data sources.

Convert English to Arabic number without changing any regional settings in .net

Well, most applications that I worked with was multilingual that supports English UI and Arabic UI.

And one of the major issue that we have faced is displaying Arabic numbers without the need of changing the regional settings of the PC.

So the code below will help you to display Arabic number without changing any regional settings.
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