B
bschuler
I am trying to create a sum total for several text fields. I am using the
following query:
SELECT [Netxpro Client Holdings].CUSIP, [Netxpro Client Holdings].[Security
Description], [Bloomberg - All holdings].[Security Type], [Bloomberg - All
holdings].Cpn, [Netxpro Client Holdings].Quantity, [Netxpro Client
Holdings].Value, [Bloomberg - All holdings].Jan, [Bloomberg - All
holdings].Feb, [Bloomberg - All holdings].Mar, [Bloomberg - All
holdings].Apr, [Bloomberg - All holdings].May, [Bloomberg - All
holdings].Jun, [Bloomberg - All holdings].Jul, [Bloomberg - All
holdings].Aug, [Bloomberg - All holdings].Sep, [Bloomberg - All
holdings].Oct, [Bloomberg - All holdings].Nov, [Bloomberg - All
holdings].Dec,
(NZ([Jan],0)+NZ([Feb],0)+NZ([Mar],0)+NZ([Apr],0)+NZ([May],0)+NZ([Jun],0)+NZ([Jul],0)+NZ([Aug],0)+NZ([Sep],0)+NZ([Oct],0)+NZ([Nov],0)+NZ([Dec],0))*[Quantity] AS AnnualInc
FROM [Netxpro Client Holdings] LEFT JOIN [Bloomberg - All holdings] ON
[Netxpro Client Holdings].CUSIP = [Bloomberg - All holdings].Cusip;
I am using the NZ function because some of the field records contain null
values. For these records I obtain the results I would expect. The problem
occurs when there is not a null value for any of fields for a record. In
these instances the function creates an error.
following query:
SELECT [Netxpro Client Holdings].CUSIP, [Netxpro Client Holdings].[Security
Description], [Bloomberg - All holdings].[Security Type], [Bloomberg - All
holdings].Cpn, [Netxpro Client Holdings].Quantity, [Netxpro Client
Holdings].Value, [Bloomberg - All holdings].Jan, [Bloomberg - All
holdings].Feb, [Bloomberg - All holdings].Mar, [Bloomberg - All
holdings].Apr, [Bloomberg - All holdings].May, [Bloomberg - All
holdings].Jun, [Bloomberg - All holdings].Jul, [Bloomberg - All
holdings].Aug, [Bloomberg - All holdings].Sep, [Bloomberg - All
holdings].Oct, [Bloomberg - All holdings].Nov, [Bloomberg - All
holdings].Dec,
(NZ([Jan],0)+NZ([Feb],0)+NZ([Mar],0)+NZ([Apr],0)+NZ([May],0)+NZ([Jun],0)+NZ([Jul],0)+NZ([Aug],0)+NZ([Sep],0)+NZ([Oct],0)+NZ([Nov],0)+NZ([Dec],0))*[Quantity] AS AnnualInc
FROM [Netxpro Client Holdings] LEFT JOIN [Bloomberg - All holdings] ON
[Netxpro Client Holdings].CUSIP = [Bloomberg - All holdings].Cusip;
I am using the NZ function because some of the field records contain null
values. For these records I obtain the results I would expect. The problem
occurs when there is not a null value for any of fields for a record. In
these instances the function creates an error.