Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

I'm working with vb.net 2005, Business Applications, a SQL Server report. In my report I have parameters that are multi-valued - this option can be set in the Report Parameters box. When the client goes to run the report, the drop down list for the multi-value parameter is a series of check boxes. I think this is pretty handy -

 

except I can't get it to work in my stored procedure. If I pass in just one value, it works. If I pass in more than one value, it doesn't. The error message I get is 'Conversion failed when converting the nvarchar value '305,353' to data type int.

 

This is my stored procedure:

[highlight=sql]

CREATE PROCEDURE [dbo].[spTenderReport]

@Date_Begin datetime,

@Date_End datetime,

@STORENUM nvarchar(100),

@Tender nvarchar(50)

AS

BEGIN

-- SET NOCOUNT ON added to prevent extra result sets from

-- interfering with SELECT statements.

SET NOCOUNT ON;

 

-- Insert statements for procedure here

SELECT

StoreID,

[Name],

BatchNumber,

OpeningTime,

ClosingTime,

TransactionNumber,

Price,

Quantity,

[iD],

ItemLookupCode,

Description,

TenderID,

TenderDesc

 

FROM view_TenderReporting

 

WHERE OpeningTime >= @Date_Begin

AND ClosingTime <= @Date_End

 

AND StoreID IN (@STORENUM)

 

AND TenderID in (@Tender)

END

GO

[/highlight]

Right now I am only trying to send in the multi-values through @STORENUM, I haven't tried working with @Tender yet.

 

Could someone please help. I admit I am not well-versed in complex SQL, which I have a feeling is what my code needs.......:confused:

Edited by PlausiblyDamp

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...