Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
pharoah35
Yak Posting Veteran
81 Posts |
Posted - 2003-06-30 : 08:41:47
|
| Good morning Ladies & GentsThe following Stored Proceedure had been returning results then sudenly stoped. Would you be able to decipher what may be incorrect with the sp______________________________________________________________________Alter Procedure sp_training_test (@Start_Date As DateTime, @End_Date As DateTime)/* ( @parameter1 datatype = default value, @parameter2 datatype OUTPUT )*/AsSELECT [HISTRY INV-LINE].INVOICE#, [HISTRY INV-HEADER].[INVOICE-DATE], [HISTRY INV-LINE].[QTY-SHP], [IDEAS INVENTORY].[VNDR-ITEM#], [IDEAS INVENTORY].[DESC] AS DESCRIPTION, [HISTRY INV-LINE].[DLR-PRICE] / 100 AS [UNIT SALE], [HISTRY INV-LINE].[QTY-SHP] * [HISTRY INV-LINE].[DLR-PRICE] / 100 AS [EXT SALE], [HISTRY INV-LINE].[QTY-SHP] * ([HISTRY INV-LINE].[DLR-PRICE] / 100 - [HISTRY INV-LINE].[DLR-PRICE] / 100) AS PROFIT, @Start_Date, @End_DateFROM dbo.[HISTRY INV-LINE] INNER JOIN dbo.[HISTRY INV-HEADER] ON dbo.[HISTRY INV-LINE].INVOICE# = dbo.[HISTRY INV-HEADER].INVOICE# INNER JOIN dbo.[IDEAS INVENTORY] ON dbo.[HISTRY INV-LINE].DP# = dbo.[IDEAS INVENTORY].DP#WHERE (dbo.[IDEAS INVENTORY].BRAND = 'training') AND [HISTRY INV-HEADER].[INVOICE-DATE] >= @Start_Date AND [HISTRY INV-HEADER].[INVOICE-DATE] <= @End_Date and[HISTRY INV-LINE].[QTY-SHP] <> 0ORDER BY [HISTRY INV-HEADER].[INVOICE-DATE], [HISTRY INV-LINE].INVOICE#COMPUTESUM([HISTRY INV-LINE].[QTY-SHP] * [HISTRY INV-LINE].[DLR-PRICE] / 100),SUM([HISTRY INV-LINE].[QTY-SHP] * [HISTRY INV-LINE].[DLR-PRICE] / 100),SUM([HISTRY INV-LINE].[QTY-SHP] * ([HISTRY INV-LINE].[DLR-PRICE] / 100 - [HISTRY INV-LINE].[DLR-PRICE] / 100))______________________________________________________________________As always, Thanks in advancepharoah35 |
|
|
mr_mist
Grunnio
1870 Posts |
Posted - 2003-06-30 : 09:11:10
|
| Does the query work if you run it from query analyzer without it being part of a procedure?Are you sure there are invoices in the date range you are specifying?What has changed?-------Moo. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-06-30 : 15:58:58
|
Its one of those damn miracle things again...There are no miracles, because Mr. Mist is correct:quote: What has changed?
Either you changed code or data population doesn't meet your original reqs.A bovine MOO to Mr. MistAnd a plain old MOOBrett8-)EDIT: And what's with the spaces in the name and special chars?Did you inherit this?Edited by - x002548 on 06/30/2003 16:00:04 |
 |
|
|
|
|
|
|
|