Solved

stored procedure, retrieve data

Posted on 2014-01-24
1
173 Views
Last Modified: 2014-01-30
hi,

the stored procedure works, but, he doesn't goes inside the if

if objRecPeriode0("source") = "agenda" then


how can we change that? thx


the stored procedure sends us back
objRecPeriode0("source") = agenda
objRecPeriode0("nbr") = 5000








<%
CmdPeriode = "exec statgeneral " & _
"@periode=0"	
Set objRecPeriode0 = cn.Execute(CmdPeriode)


do while not objRecPeriode0.eof	
response.write objRecPeriode0("source") & "-" & objRecPeriode0("nbr") & "<br>"
exclu0 = 0
if objRecPeriode0("source") = "agenda" then

exclu0 = exclu0 + objRecPeriode0("nbr")
agenda0 = agenda0 + objRecPeriode0("nbr")

end if 


if objRecPeriode0("source") = "commerce monitor" then
exclu0 = exclu0  + objRecPeriode0("nbr")
commercemonitor0 = commercemonitor0 +  objRecPeriode0("nbr")
end if 


objRecPeriode0.movenext




loop

response.write exclu0
response.write agenda0
response.write commercemonitor0



%>

Open in new window

0
Comment
Question by:fedkris
1 Comment
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 39806605
first thing i would check is to make sure it's returning data, any data, correctly. is the nbr field coming back?

if so, check for trailing whitespaces in the field. change

if objRecPeriode0("source") = "agenda" then

to

if Trim( objRecPeriode0("source") ) = "agenda" then
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now