RE: asp not retrieving correct information from a query



The environment is like this:
+windows 2000
+IIS
+ASP 3.0
+MS SQL 2000

The asp that runs the process has this portion of code:

set Conn1=Server.CreateObject ("ADODB.Connection")
set Conn2=Server.CreateObject ("ADODB.Connection")
set rs=Server.CreateObject ("ADODB.Recordset")

Conn1.Open Application("strConexion")
Conn2.Open Application("strConexion")

SQL = "spS_PrepareFunnelForecastReport '" & strFechaParam & "'"
Conn1.Execute(SQL)

SQL = "select * from temptbFunnelForecast"
SET rs = Conn2.Execute(SQL)


and the stored proc spS_PrepareFunnelForecastReport is like this:



SELECT tbStates1.zona_geografica, Usuarios1.Nombre AS Gerente,
Usuarios_1.Nombre AS PBM, Usuarios2.Nombre AS TSG, Usuarios3.Nombre AS PSG,
Usuarios4.Nombre AS IPG,
dbo.dependencias_cat.DESCRIPCION AS Cliente, dbo.dependencias_cat.ESTRATEGICA
AS Listada,
dbo.dependencias_cat.GEM AS SP,
dbo.SOLICITUDES.NOMBRE_PROY, DISTRIBUIDORES1.EMPRESA AS Mayorista,
DISTRIBUIDORES_1.EMPRESA AS Distribuidor,
dbo.PEDIDOS.NO_PARTE, dbo.CPQGOB_EQUIPOS.Activo, dbo.CPQGOB_EQUIPOS.BU,
dbo.CPQGOB_EQUIPOS.DESCRIPCION, dbo.CPQGOB_EQUIPOS.PL,
dbo.CAT_STATUS_SOLICITUD.CICLOVENTA, dbo.CPQGOB_EQUIPOS.PRECIOUSD,
dbo.PEDIDOS.CANTIDAD, dbo.CPQGOB_EQUIPOS.PRECIOUSD *
dbo.PEDIDOS.CANTIDAD AS Total, dbo.SOLICITUDES.FEC_OF_LEGAL,
dbo.SOLICITUDES.FEC_FALLO,
dbo.SOLICITUDES.FEC_ENTREGA_BIENES, dbo.SOLICITUDES.ID_SOLICITUD,
dbo.SOLICITUDES.FEC_ULTIMA_ACT,
dbo.SOLICITUDES.numero_licitacion,
dbo.CAT_STATUS_SOLICITUD.DESCRIPCION AS Status, dbo.CAT_FALLO.DESCRIPCION AS
Fallo, dbo.SOLICITUDES.DualAgregation,
dbo.SOLICITUDES.FEC_SOLICITUD, tbStates1.StateName AS
[Localidad distribuidor], tbStates_1.StateName AS [Localidad cliente]
INTO temptbFunnelForecast
FROM dbo.DISTRIBUIDORES DISTRIBUIDORES_1 RIGHT OUTER JOIN
dbo.DISTRIBUIDORES DISTRIBUIDORES1 RIGHT OUTER JOIN
dbo.CAT_STATUS_SOLICITUD INNER JOIN
dbo.SOLICITUDES INNER JOIN
dbo.dependencias_cat ON dbo.SOLICITUDES.DEPENDENCIA =
dbo.dependencias_cat.ID ON
dbo.CAT_STATUS_SOLICITUD.ID_STATUS =
dbo.SOLICITUDES.STATUS LEFT OUTER JOIN
dbo.tbStates tbStates_1 ON dbo.SOLICITUDES.ESTADO =
tbStates_1.StateId ON DISTRIBUIDORES1.ID_EMPRESA =
dbo.SOLICITUDES.ID_Mayorista ON
DISTRIBUIDORES_1.ID_EMPRESA =
dbo.SOLICITUDES.ID_EMPRESA LEFT OUTER JOIN
dbo.CAT_FALLO INNER JOIN
dbo.RESULTADOS ON dbo.CAT_FALLO.ID_FALLO =
dbo.RESULTADOS.FALLO ON
dbo.SOLICITUDES.ID_SOLICITUD =
dbo.RESULTADOS.ID_SOLICITUD LEFT OUTER JOIN
dbo.CPQGOB_EQUIPOS INNER JOIN
dbo.PEDIDOS ON dbo.CPQGOB_EQUIPOS.NO_PARTE =
dbo.PEDIDOS.NO_PARTE ON
dbo.SOLICITUDES.ID_SOLICITUD =
dbo.PEDIDOS.ID_SOLICITUD LEFT OUTER JOIN
dbo.DependenciasAdministradoresVenta INNER JOIN
dbo.Usuarios Usuarios2 ON
dbo.DependenciasAdministradoresVenta.idUsuarioTSG = Usuarios2.idUsuario INNER
JOIN
dbo.Usuarios Usuarios3 ON
dbo.DependenciasAdministradoresVenta.idUsuarioPSG = Usuarios3.idUsuario INNER
JOIN
dbo.Usuarios Usuarios4 ON
dbo.DependenciasAdministradoresVenta.idUsuarioIPG = Usuarios4.idUsuario ON
dbo.SOLICITUDES.DEPENDENCIA =
dbo.DependenciasAdministradoresVenta.idDependencia LEFT OUTER JOIN
dbo.Usuarios Usuarios1 INNER JOIN
dbo.GerenteDistritoEjecutivosCuentas ON
Usuarios1.idUsuario = dbo.GerenteDistritoEjecutivosCuentas.IdUsuarioGte RIGHT
OUTER JOIN
dbo.Usuarios Usuarios_1 INNER JOIN
dbo.DistribuidoresEjecutivosCuentas ON
Usuarios_1.idUsuario = dbo.DistribuidoresEjecutivosCuentas.idUsuario ON
dbo.GerenteDistritoEjecutivosCuentas.IdUsuarioPBM =
dbo.DistribuidoresEjecutivosCuentas.idUsuario ON
dbo.SOLICITUDES.ID_EMPRESA =
dbo.DistribuidoresEjecutivosCuentas.idDistribuidor LEFT OUTER JOIN
dbo.tbStates tbStates1 ON DISTRIBUIDORES_1.ESTADO =
tbStates1.StateId
where solicitudes.fec_solicitud >=@dtInicioFechaSolicitud
order by solicitudes.id_solicitud

----------------------------------------------------------

"Luke Zhang [MSFT]" wrote:

Hello,

Regarding the issue, would you please show more detailed code? For example,
how did you call the store procedure, query and display the data in the
ASP page, and what is the query you executed in query analyzer? Based on
my experience, this is more like an problem in coding. So we better double
check the logic in the code.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.




.



Relevant Pages

  • Re: Relational question
    ... left outer join ... >) as AB inner join ( ... >>Let's look at the first LEFT JOIN query: ... >>which we'll refer to collectively as and the constituent queries ...
    (microsoft.public.sqlserver.programming)
  • Re: Close vs "nothing"
    ... >> The result is therefore the same as an inner join. ... >> For more info about handling nulls, ... >>> with info from many locations holding period information. ... >>> I am trying left outer join with dates table on left and data on right ...
    (microsoft.public.access.modulesdaovba)
  • Re: MULTIPLE JOINS
    ... An inner join is like a cross join to which we apply a where clause: ... An outer join decides to keep all the records from ONE of the tables. ... If the logical equivalent WHERE would ... There are two other types of outer joins not supported in Jet. ...
    (microsoft.public.access.queries)
  • Re: Can someone please explain this ?
    ... INSERT Test1 (Number1, Letter1) ... INNER JOIN Test2 ... LEFT OUTER JOIN Test2 ...
    (microsoft.public.sqlserver.programming)
  • RE: Aggregates, Joins, I am totally stuck on this issue
    ... a left outer join it makes it an inner join? ... I have two aggregate queries which are grouped on ... >> query and then create an append query which puts the results of this master ... >> a LEFT OUTER JOIN and run it and what do it get? ...
    (microsoft.public.access.queries)