|
-
July 15th, 2010, 12:42 AM
#1
Help me in coding....
Hi..
Am using vb6.0, crystal report 8.5 and sql 2000 server in my project.. I want to create one combo box in report form in which i ve to display some person names from database..
I did it for date, when we select any date, report displays corresponding information. I had used stored procedure for dis.. Bellow code shows this stored procedure to display info based on date.. But am not getting coding for combo box..
Plz help me in coding..
Code:
Code:
CREATE PROCEDURE usp_CONTRIBUTION(@StDt Char(10),@EnDt Char(10)) AS
BEGIN
Declare @numrows int,@errno int,@errmsg varchar(255),@error int,
@sDt Datetime,@eDt DateTime
SET NOCOUNT ON
SET DATEFORMAT MDy
set @sDt=@StDt
set @eDt=@EnDt
/* finding landed cost of each tool from bincards*/
SELECT BcTpSlNo,AVG(BcBprice) AS LC,TpSku AS ToolId
Into #LC1
FROM Bincards,ToProdut
WHERE BcTpSlNo=TpSlNo
GROUP BY BcTpSlNo,TpSKU
ORDER BY BcTpSlNo
/* finding landed cost of invoiced tools*/
SELECT ItIhSlno,ItQty,LC,(LC * ItQty) AS TLC INTO #LC2
FROM InvoicTo,#LC1
WHERE BcTpSlNo=ItTpSlNo
SELECT ItIhSlNo,SUM(ItQty) as Qty,SUM(LC) as LC,SUM(TLC) as TLC INTO #LC3 FROM #LC2
GROUP BY ItIhSLNo ORDER By ItIhSlNo
SELECT Qty,LC,IhSKU,IhSubtotal as Discounts,IhItemTotal as ItemTotal,
TLC,(IhItemTotal-IhSubTotal) as AmtAftDis,
AdOrganization,AdCity,AdState,Adzone,RtSKU
FROM InvoicHe,#LC3,AddresMt,RatingMt
WHERE ItIhSlno=IhSlno
AND IhAdSlno=AdSlno
AND AdRtSlno=RtSlNo
AND Ihdate BETWEEN @SDt AND @EDt
ORDER BY Ihsku
END
GO
Last edited by HanneSThEGreaT; July 15th, 2010 at 02:51 AM.
Reason: Added [CODE] Tags!
-
July 15th, 2010, 01:18 AM
#2
Re: Help me in coding....
The report does nothing but pick two dates, and call the SP.
It does it's thing, then spits out the date range to the report.
You don't have any NAME field in your data, so, your report can't show it
-
July 15th, 2010, 01:39 AM
#3
Re: Help me in coding....
Hi dglienna..
Yes don ve any data in this SP, but i want same SP which ve to work for combo box.. I need to some names from db table n display it in combo box.. When we select one name, the report to be display information of that selected person..
-
July 15th, 2010, 02:51 AM
#4
Re: Help me in coding....
arunvb, please make use of [CODE] tags when posting code, it makes it easier for us to read your code.
Thank you,
Hannes
-
July 15th, 2010, 03:42 AM
#5
Re: Help me in coding....
Hi Hannes ..
I did it.. Please see in #1 of this thread...
-
July 15th, 2010, 04:54 AM
#6
-
July 15th, 2010, 12:32 PM
#7
Re: Help me in coding....
Not to mention the fact that T-SQL and Stored Procdeure has very little to do with VB6. You could write a simple query
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|