Avatar of ExtremeFitness
ExtremeFitness asked on

Not receiving values from database

I have several databases with the store procedure identified below.  When I connect to all but one I get the value for the gross field, but in one of the location I get zeros for the gross field in Crystal Report.  Can anyone shed some light?



ALTER PROCEDURE [dbo].[USP_CorporateDealsPaidByMember]
      @sDate DATETIME,
      @eDate DATETIME
 AS
      
SELECT C.Employer, C.Old_Contract_Id, C.First_Name, C.Last_Name,
      C.Monthly_Dues, MS.Status, C.Date, Option_Name, ISNULL(C.Initiation,0) + (ISNULL(C.Term, 0) * ISNULL(C.Monthly_Dues,0)) AS Gross
FROM Customers AS C JOIN
      Member_Status AS MS ON MS.Status_Id = C.Status
WHERE (Option_Name LIKE '%20[%]%' OR Option_Name LIKE '%30[%]%' ) AND
      Debit_Method <> 'PDC' AND
      C.Date BETWEEN @sDate AND @eDate AND
      C.Employer <> ''

Crystal Reports

Avatar of undefined
Last Comment
ExtremeFitness

8/22/2022 - Mon
Mike McCracken

ANy chance the fields are 0 or NULL in that database?

mlmcc
ASKER
ExtremeFitness

Nope ... I handled that in the store procedure.  
The field in questing is the 'Gross' field
Mike McCracken

I know you handled it, thus you are getting 0s.  My question is, in that database are all the values 0 or NULL?

mlmcc
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
ASKER CERTIFIED SOLUTION
Mike McCracken

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
ExtremeFitness

But I am getting zeros for all records.
When I execute the stored procedure in the server studio, I get values.


It seemst that when I set the database to the particular location and then use VB to switch from database to database it works.

Weird...