Showing posts with label expect. Show all posts
Showing posts with label expect. Show all posts

Thursday, March 29, 2012

Formula in a View

I'm trying to perform the following within a view. I'm not getting the
values which I would expect. I'm assuming I have a data type problem where
some precision is being dropped. Could someone give me a heads-up on what
I'm doing wrong? I need full precision.
SUM(((MarketPrice+MarketPriceUp100-(2*MarketPriceUp50))/(MarketPriceUp50*((1
00/10000)^2))/100)
* MarketValue)/ SUM(MarketValue) as [Convexity],
Thanks,
Tom Woods
The Baker Group, LP"Tom Woods" <twoods@.jamesbaker.com> wrote in message
news:OgZCcxTvFHA.2396@.TK2MSFTNGP14.phx.gbl...
> I'm trying to perform the following within a view. I'm not getting the
> values which I would expect. I'm assuming I have a data type problem
> where some precision is being dropped. Could someone give me a heads-up
> on what I'm doing wrong? I need full precision.
>
> SUM(((MarketPrice+MarketPriceUp100-(2*MarketPriceUp50))/(MarketPriceUp50*(
(100/10000)^2))/100)
> * MarketValue)/ SUM(MarketValue) as [Convexity],
>
What are the types of those columns?
Integral types use integer division.
David|||All columns in the formula are 9(12,8).
"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> wrote in
message news:uyQL80TvFHA.1560@.TK2MSFTNGP09.phx.gbl...
> "Tom Woods" <twoods@.jamesbaker.com> wrote in message
> news:OgZCcxTvFHA.2396@.TK2MSFTNGP14.phx.gbl...
> What are the types of those columns?
> Integral types use integer division.
> David
>|||Hi Tom
This piece of the expression (100/10000) will be carried out as integer
division, and yield 0. If you want decimal results, make at least one of the
operands a decimal (100.0/10000)
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"Tom Woods" <twoods@.jamesbaker.com> wrote in message
news:OgZCcxTvFHA.2396@.TK2MSFTNGP14.phx.gbl...
> I'm trying to perform the following within a view. I'm not getting the
> values which I would expect. I'm assuming I have a data type problem
> where some precision is being dropped. Could someone give me a heads-up
> on what I'm doing wrong? I need full precision.
>
> SUM(((MarketPrice+MarketPriceUp100-(2*MarketPriceUp50))/(MarketPriceUp50*(
(100/10000)^2))/100)
> * MarketValue)/ SUM(MarketValue) as [Convexity],
> Thanks,
> Tom Woods
> The Baker Group, LP
>|||When I change it to the following I get an error. Could the problem be with
the exponent? Is there a different way of performing the exponential?
((100.0/10000)^2)
BTW, I get the following error when changing 100 to 100.0
--
Microsoft SQL-DMO (ODBC SQLState: 42000)
--
Error 403: Invalid operator for data type. Operator equals boolean XOR, type
equals numeric.
--
OK
--
Thanks,
Tom
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:usIhD4TvFHA.1032@.TK2MSFTNGP12.phx.gbl...
> Hi Tom
> This piece of the expression (100/10000) will be carried out as integer
> division, and yield 0. If you want decimal results, make at least one of
> the operands a decimal (100.0/10000)
> --
> HTH
> Kalen Delaney, SQL Server MVP
> www.solidqualitylearning.com
>
> "Tom Woods" <twoods@.jamesbaker.com> wrote in message
> news:OgZCcxTvFHA.2396@.TK2MSFTNGP14.phx.gbl...
>
>|||^ operator is bitwise exclusive OR operation for integers. For getting
exponential values as results you might want to try POWER function like:
SELECT POWER( 100.0/10000, 2 )
Anith|||Can you use (1.0/10000) instead of ((100.0/10000)^2)?
Perayu
"Tom Woods" <twoods@.jamesbaker.com> wrote in message
news:uVvmS$TvFHA.596@.TK2MSFTNGP12.phx.gbl...
> When I change it to the following I get an error. Could the problem be
> with the exponent? Is there a different way of performing the
> exponential?
> ((100.0/10000)^2)
>
> BTW, I get the following error when changing 100 to 100.0
> --
> Microsoft SQL-DMO (ODBC SQLState: 42000)
> --
> Error 403: Invalid operator for data type. Operator equals boolean XOR,
> type equals numeric.
> --
> OK
> --
> Thanks,
> Tom
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:usIhD4TvFHA.1032@.TK2MSFTNGP12.phx.gbl...
>|||I was able to get it to work by using the POWER function and also changing
the integer values to have precision.
Thanks,
Tom
"Perayu" <yu.he@.state.mn.us.Remove4Replay> wrote in message
news:uPKrC0UvFHA.908@.tk2msftngp13.phx.gbl...
> Can you use (1.0/10000) instead of ((100.0/10000)^2)?
> Perayu
> "Tom Woods" <twoods@.jamesbaker.com> wrote in message
> news:uVvmS$TvFHA.596@.TK2MSFTNGP12.phx.gbl...
>

Tuesday, March 27, 2012

Forms Authentication Problem

I expect that this is a trivial problem, but I've banged my head on it
for long enough. I'm hoping there's someone out there that can help!
:-)
I have the MS sample for forms authentication
(http://msdn.microsoft.com/library/?url=/library/en-us/dnsql2k/html/ufairs.asp)
working just fine. Once I got that working, I translated it to VB.
(We're a VB shop, so if/when I roll out RS, pretty much everything
needs to be in VB.) As far as I know, I've converted it very
accurately and exactly. However, when I try to run the VB version
(e.g. navigate to http://localhost/ReportServer/logon.aspx), I receive
the following error:
================================================== Server Error in '/ReportServer' Application.
----
Parser Error
Description: An error occurred during the parsing of a resource
required to service this request. Please review the following specific
parse error details and modify your source file appropriately.
Parser Error Message: Could not load type
'Microsoft.Samples.ReportingServices.CustomSecurity.Logon'.
Source Error:
Line 1: <%@. Page language="vb" AutoEventWireup="false"
Codebehind="Logon.aspx.vb"
Inherits="Microsoft.Samples.ReportingServices.CustomSecurity.Logon" %>
Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
Line 3: <HTML>
Source File: C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\logon.aspx Line: 1
----
Version Information: Microsoft .NET Framework Version:1.1.4322.573;
ASP.NET Version:1.1.4322.573
==================================================
It seems as though RS is not loading the appropriate assembly. Can
anyone shed any light on this?
Thanks a lot!
Brad.OK, I think I've solved my own problem. In VB, I needed to add the
<%@. Assembly Name="Microsoft.Samples.ReportingServices.CustomSecurity"
%> directive to the aspx pages so that the right assembly would get
loaded. I hope that helps others. :-)
Brad.
On Wed, 01 Sep 2004 16:26:42 -0600, Bradley Plett <plettb@.hotmail.com>
wrote:
>I expect that this is a trivial problem, but I've banged my head on it
>for long enough. I'm hoping there's someone out there that can help!
>:-)
>I have the MS sample for forms authentication
>(http://msdn.microsoft.com/library/?url=/library/en-us/dnsql2k/html/ufairs.asp)
>working just fine. Once I got that working, I translated it to VB.
>(We're a VB shop, so if/when I roll out RS, pretty much everything
>needs to be in VB.) As far as I know, I've converted it very
>accurately and exactly. However, when I try to run the VB version
>(e.g. navigate to http://localhost/ReportServer/logon.aspx), I receive
>the following error:
>==================================================>Server Error in '/ReportServer' Application.
>----
>Parser Error
>Description: An error occurred during the parsing of a resource
>required to service this request. Please review the following specific
>parse error details and modify your source file appropriately.
>Parser Error Message: Could not load type
>'Microsoft.Samples.ReportingServices.CustomSecurity.Logon'.
>Source Error:
>
>Line 1: <%@. Page language="vb" AutoEventWireup="false"
>Codebehind="Logon.aspx.vb"
>Inherits="Microsoft.Samples.ReportingServices.CustomSecurity.Logon" %>
>Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
>Transitional//EN">
>Line 3: <HTML>
>
>Source File: C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
>Services\ReportServer\logon.aspx Line: 1
>
>----
>Version Information: Microsoft .NET Framework Version:1.1.4322.573;
>ASP.NET Version:1.1.4322.573
>==================================================>It seems as though RS is not loading the appropriate assembly. Can
>anyone shed any light on this?
>Thanks a lot!
>Brad.sql