Note that there are some explanatory texts on larger screens.

plurals
  1. POStored procedure not returning any value after taking id of particular item
    primarykey
    data
    text
    <p>I have a stored procedure like this:</p> <pre><code>ALTER PROCEDURE [dbo].[T_TransactionSummary] @startDate datetime, @endDate datetime, @locations nvarchar(50) AS BEGIN DECLARE @fromDate datetime = CONVERT(varchar(10), @startDate, 121) + ' 00:00:00.000'; DECLARE @toDate datetime = CONVERT(varchar(10), @endDate, 121) + ' 11:59:59.999'; SELECT COUNT(*) AS CarCount, Location_tbl.LocName, REPLACE(CONVERT(varchar(11), Transaction_tbl.dtime, 113), ' ', '-') AS Date_time, CASE Transaction_tbl.Compl WHEN 'True' THEN 'Complementary' WHEN 'False' THEN 'Non-Complementary' ELSE 'Other' END AS Expr1, VType_tbl.Vtype, CASE WHEN (VType_tbl.Vtype = 'Normal' AND Transaction_tbl.Compl = 'False') THEN COUNT(*) * 50 WHEN (VType_tbl.Vtype = 'VIP' AND Transaction_tbl.Compl = 'False') THEN COUNT(*) * 100 ELSE 0 END AS Total, CASE WHEN Transaction_tbl.Paid = 'False' THEN 0 ELSE SUM(Transaction_tbl.PAmount) END AS CIH FROM Transaction_tbl INNER JOIN Location_tbl ON (Transaction_tbl.Locid = Location_tbl.Locid) LEFT OUTER JOIN VType_tbl ON (Transaction_tbl.vtid = VType_tbl.vtid) LEFT OUTER JOIN Make_tbl ON (Transaction_tbl.mkid = Make_tbl.mkid) LEFT OUTER JOIN Color_tbl ON (Transaction_tbl.Colid = Color_tbl.colid) LEFT OUTER JOIN PlateSource_tbl ON (Transaction_tbl.PSID = PlateSource_tbl.PSID) WHERE (Transaction_tbl.dtime BETWEEN @fromDate AND @toDate) AND (Location_tbl.Locid IN (SELECT locid FROM location_tbl WHERE locname IN (@locations))) GROUP BY Location_tbl.LocName, REPLACE(CONVERT(varchar(11), Transaction_tbl.dtime, 113), ' ', '-'), VType_tbl.Vtype, Transaction_tbl.Compl, Transaction_tbl.Paid ORDER BY Location_tbl.LocName, Date_time DESC, VType_tbl.Vtype, Transaction_tbl.Compl END </code></pre> <p>I am passing Date and locations like this:</p> <pre><code>@startDate = '2013-01-01', @endDate = '2013-10-01', @locations = 'Blooming Dale,Fashion Avenue' </code></pre> <p>but am not getting any value...what is wrong with my stored procedure</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload