We help IT Professionals succeed at work.
Get Started

VS 2005 Dataset question

rcowen00
rcowen00 asked
on
296 Views
Last Modified: 2012-06-22
dataset box
What populates the drop down in the Value field?  I have a parameter that is showing up but isn't reflected in the stored procedure (@Status).  Thank you.
--ReportIndividualsbyState 49, 0,0,0,'0','0'
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[ReportIndividualsbyState]( @CompanyProfileKey int, @LicenseStatusKey int = NULL,@StateKey int = NULL,@BranchProfileKey int = NULL,@TeamID varchar(50)='0' , @GroupID varchar(50)='0', @IndStatusKey int = 2 )
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	-- active individuals
	IF @IndStatusKey = 2
		BEGIN
	SELECT        c.CompanyName, (CASE WHEN @BranchProfileKey IS NULL THEN 'All Branches' ELSE b.BranchName END) AS BranchName, dbo.FormatFullName(lo.FirstName, 
	                         lo.LastName, '') AS FullName, lo.NMLSID, b.BranchNumber, s.StateAbbr, lio.IndividualLicenseName AS LicenseName, lo.GroupID AS Groups, lo.TeamID AS Team, 
	                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE lol.License_ID END) AS License_ID, 
	                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE CONVERT(varchar(25), lol.IssueDate, 101) END) AS IssueDate, 
	                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE CONVERT(varchar(25), dbo.GetLicenseRenewalDate(lol.LicenseKey, 0), 101) END) AS ExpirationDate, 
	                         dbo.GetLicenseStatusText(lol.LicenseKey) AS LicenseStatus, lo.LastName, lol.LastRenewalDate
	FROM            LoanOfficerLicense AS lol INNER JOIN
	                         LoanOfficerProfile AS lo ON lo.LoanOfficerProfileKey = lol.LoanOfficerProfileKey INNER JOIN
	                         LicenseInformationLoanOfficer AS lio ON lio.LicenseInformationLoanOfficerKey = lol.LicenseInformationLoanOfficerKey INNER JOIN
	                         LicenseInformation AS li ON li.LicenseInformationKey = lio.LicenseInformationKey INNER JOIN
	                         State AS s ON s.StateKey = li.StateKey INNER JOIN
	                         BranchProfile AS b ON b.BranchProfileKey = lo.BranchProfileKey INNER JOIN
	                         CompanyProfile AS c ON c.CompanyProfileKey = lo.CompanyProfileKey LEFT OUTER JOIN
	                         Address AS a1 ON a1.AddressKey = lo.ResAddressKey
	WHERE        (li.StateKey = ISNULL(NULLIF (@StateKey, 0), li.StateKey)) AND (lo.CompanyProfileKey = @CompanyProfileKey) AND 
	                         (lo.BranchProfileKey = ISNULL(NULLIF (@BranchProfileKey, 0), lo.BranchProfileKey)) AND (lol.LicenseStatusKey = ISNULL(NULLIF (@LicenseStatusKey, 0), 
	                         lol.LicenseStatusKey)) AND (lo.TeamID = ISNULL(NULLIF (@TeamID, '0'), lo.TeamID)) AND (lo.GroupID = ISNULL(NULLIF (@GroupID, '0'), lo.GroupID)) AND 
	                         (b.DeletedFlag = 0) AND (lo.DeletedFlag = 0) AND (lol.DeletedFlag = 0) AND (lo.InactiveDate IS NULL)
	ORDER BY lo.LastName
END
ELSE
				-- inactive records.
				IF @IndStatusKey = 3
				BEGIN
				SELECT        c.CompanyName, (CASE WHEN @BranchProfileKey IS NULL THEN 'All Branches' ELSE b.BranchName END) AS BranchName, dbo.FormatFullName(lo.FirstName, 
				                         lo.LastName, '') AS FullName, lo.NMLSID, b.BranchNumber, s.StateAbbr, lio.IndividualLicenseName AS LicenseName, lo.GroupID AS Groups, lo.TeamID AS Team, 
				                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE lol.License_ID END) AS License_ID, 
				                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE CONVERT(varchar(25), lol.IssueDate, 101) END) AS IssueDate, 
				                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE CONVERT(varchar(25), dbo.GetLicenseRenewalDate(lol.LicenseKey, 0), 101) END) AS ExpirationDate, 
				                         dbo.GetLicenseStatusText(lol.LicenseKey) AS LicenseStatus, lo.LastName, lol.LastRenewalDate, lo.InactiveDate
				FROM            LoanOfficerLicense AS lol INNER JOIN
				                         LoanOfficerProfile AS lo ON lo.LoanOfficerProfileKey = lol.LoanOfficerProfileKey INNER JOIN
				                         LicenseInformationLoanOfficer AS lio ON lio.LicenseInformationLoanOfficerKey = lol.LicenseInformationLoanOfficerKey INNER JOIN
				                         LicenseInformation AS li ON li.LicenseInformationKey = lio.LicenseInformationKey INNER JOIN
				                         State AS s ON s.StateKey = li.StateKey INNER JOIN
				                         BranchProfile AS b ON b.BranchProfileKey = lo.BranchProfileKey INNER JOIN
				                         CompanyProfile AS c ON c.CompanyProfileKey = lo.CompanyProfileKey LEFT OUTER JOIN
				                         Address AS a1 ON a1.AddressKey = lo.ResAddressKey
				WHERE        (li.StateKey = ISNULL(NULLIF (@StateKey, 0), li.StateKey)) AND (lo.CompanyProfileKey = @CompanyProfileKey) AND 
				                         (lo.BranchProfileKey = ISNULL(NULLIF (@BranchProfileKey, 0), lo.BranchProfileKey)) AND (lol.LicenseStatusKey = ISNULL(NULLIF (@LicenseStatusKey, 0), 
				                         lol.LicenseStatusKey)) AND (lo.TeamID = ISNULL(NULLIF (@TeamID, '0'), lo.TeamID)) AND (lo.GroupID = ISNULL(NULLIF (@GroupID, '0'), lo.GroupID)) AND 
				                         (b.DeletedFlag = 0) AND (lo.DeletedFlag = 0) AND (lol.DeletedFlag = 0) AND (lo.InactiveDate IS NOT NULL)
				ORDER BY lo.LastName
				END
			ELSE
			-- all records.
				IF @IndStatusKey = 1
				BEGIN
SELECT        c.CompanyName, (CASE WHEN @BranchProfileKey IS NULL THEN 'All Branches' ELSE b.BranchName END) AS BranchName, dbo.FormatFullName(lo.FirstName, 
	                         lo.LastName, '') AS FullName, lo.NMLSID, b.BranchNumber, s.StateAbbr, lio.IndividualLicenseName AS LicenseName, lo.GroupID AS Groups, lo.TeamID AS Team, 
	                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE lol.License_ID END) AS License_ID, 
	                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE CONVERT(varchar(25), lol.IssueDate, 101) END) AS IssueDate, 
	                         (CASE WHEN lol.LicenseStatusKey <> 1 THEN 'N/A' ELSE CONVERT(varchar(25), dbo.GetLicenseRenewalDate(lol.LicenseKey, 0), 101) END) AS ExpirationDate, 
	                         dbo.GetLicenseStatusText(lol.LicenseKey) AS LicenseStatus, lo.LastName,lol.LastRenewalDate
	FROM            LoanOfficerLicense AS lol INNER JOIN
	                         LoanOfficerProfile AS lo ON lo.LoanOfficerProfileKey = lol.LoanOfficerProfileKey INNER JOIN
	                         LicenseInformationLoanOfficer AS lio ON lio.LicenseInformationLoanOfficerKey = lol.LicenseInformationLoanOfficerKey INNER JOIN
	                         LicenseInformation AS li ON li.LicenseInformationKey = lio.LicenseInformationKey INNER JOIN
	                         State AS s ON s.StateKey = li.StateKey INNER JOIN
	                         BranchProfile AS b ON b.BranchProfileKey = lo.BranchProfileKey INNER JOIN
	                         CompanyProfile AS c ON c.CompanyProfileKey = lo.CompanyProfileKey LEFT OUTER JOIN
	                         Address AS a1 ON a1.AddressKey = lo.ResAddressKey
	WHERE        (li.StateKey = ISNULL(NULLIF (@StateKey, 0), li.StateKey)) AND (lo.CompanyProfileKey = @CompanyProfileKey) AND 
	                         (lo.BranchProfileKey = ISNULL(NULLIF (@BranchProfileKey, 0), lo.BranchProfileKey)) AND (lol.LicenseStatusKey = ISNULL(NULLIF (@LicenseStatusKey, 0), 
	                         lol.LicenseStatusKey)) AND (lo.TeamID = ISNULL(NULLIF (@TeamID, '0'), lo.TeamID)) AND (lo.GroupID = ISNULL(NULLIF (@GroupID, '0'), lo.GroupID)) AND 
	                         (b.DeletedFlag = 0) AND (lo.DeletedFlag = 0) AND (lol.DeletedFlag = 0) 
	ORDER BY lo.LastName
	

END
END

Open in new window

Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 2 Answers and 9 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE