|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: |
IF EXISTS (SELECT * FROM tempdb..sysobjects WHERE id = object_id(N'[tempdb]..[#slotreport]')) DROP TABLE #slotreport
--IF EXISTS (SELECT * FROM tempdb..sysobjects WHERE id = object_id(N'[tempdb]..[#slotsrev]')) DROP TABLE #slotsrev
SET NOCOUNT ON
SET QUOTED_IDENTIFIER ON
DECLARE @Casino VARCHAR(20),
@MonthCount tinyint,
@VarMonth VARCHAR(3),
@BEGINDATE datetime,
@ENDDATE datetime,
@DateDays INT,
@loopvar tinyint,
@sqla varchar(5000),
@sqlb varchar(5000)
SET @monthCount = 1 -- the depth of the calculations. 12 months max!
SET @Casino = (SELECT LTRIM(RTRIM(RIGHT(DESCRIPTION, LEN(DESCRIPTION)-9))) FROM GEN_CASINO (nolock))
create table #slotreport
(
Casino varchar(20),
slotnumber int,
slotmast_id int,
par real,
LocationString varchar(40),
description varchar(254),
denomination money,
OnFloor smalldatetime,
StyleDesc varchar(30),
Manufacturer varchar(254)
)
insert into #slotreport
(
Casino,
slotnumber,
slotmast_id,
par,
LocationString,
description,
denomination,
OnFloor,
StyleDesc,
Manufacturer
)
SELECT @Casino,
a.slotnumber,
a.slotmast_id,
a.par,
a.locationstring,
a.description,
a.denomination,
a.OnFloor,
IsNull(B.StyleDesc, '##Not Set##'),
IsNull(C.Manufacturer, '##Not Set##')
FROM CDS_SLOTMAST A (nolock)
LEFT JOIN BB_STYLE b (nolock) ON a.style_id = b.style_id
LEFT JOIN BB_mfr c (nolock) ON a.mfr_id = c.mfr_id
WHERE a.active = 'Y' and a.Currentrevision = 'Y'
and a.slotnumber not between 99000 and 99999
SET @loopVar = 0
WHILE @loopVar < @monthCount
BEGIN
SET @BEGINDATE = (SELECT DATEADD(dd,-(DAY(DATEADD(mm,1,GETDATE()))-1),DATEADD(mm,-@loopvar-1,GETDATE())))
SET @ENDDATE = (SELECT DATEADD(dd, -DAY(DATEADD(m,1,GETDATE())), DATEADD(m,-@loopvar,GETDATE())))
SET @DateDays = (SELECT DATEDIFF(DAY, @BEGINDATE, @ENDDATE)+ 1)
SET @VarMonth = (SELECT RTRIM(left(DATEADD(dd, DATEDIFF(dd,0,@BEGINDATE), 0),3)))
SET @sqla = 'ALTER TABLE #slotreport ADD '+@VarMonth+'TTLCI money NOT NULL DEFAULT 0.00; '
+ 'ALTER TABLE #slotreport ADD '+@VarMonth+'TWPuPD money NOT NULL DEFAULT 0.00; '
+ 'ALTER TABLE #slotreport ADD '+@VarMonth+'CIPuPD money NOT NULL DEFAULT 0.00; '
+ 'ALTER TABLE #slotreport ADD M'+CAST(@loopVar AS VARCHAR)+'Name VARCHAR(3) NOT NULL DEFAULT ('''+@VarMonth+''');'
+ 'ALTER TABLE #slotreport ADD M'+CAST(@loopVar AS VARCHAR)+'Days VARCHAR(2) NOT NULL DEFAULT ('+CAST (@DateDays as VARCHAR)+'); '
-- CI Pu PD
SET @sqlb = 'update #slotreport '
+ 'SET '+CAST (@VarMonth as VARCHAR)+'TTLCI = amount.total '
+ 'FROM (SELECT slotmast_id, isNull(SUM(ElecCoinIn), ''0'') as total '
+ 'FROM BB_REVENUE '
+ 'WHERE period_id = ''4'' and auditdate between '''+convert(varchar(11),@BeginDate,121)+''' and '''+convert(varchar(11),@EndDate,121)+''' '
+ 'GROUP BY slotmast_id) as Amount '
+ 'WHERE #slotreport.slotmast_id = amount.slotmast_id;'
-- TW Pu PD
+ 'update #slotreport '
+ 'SET '+CAST (@VarMonth as VARCHAR)+'TWPUPD = amount.total '
+ '* (select Par from cds_slotmast where #slotreport.slotmast_id = cds_slotmast.slotmast_id) / 100 / '+CAST (@DateDays as VARCHAR)+''
+ 'FROM (SELECT slotmast_id, isNull(SUM(ElecCoinIn), ''0'') as total '
+ 'FROM BB_REVENUE '
+ 'WHERE period_id = ''4'' and auditdate between '''+convert(varchar(11),@BeginDate,121)+''' and '''+convert(varchar(11),@EndDate,121)+''' '
+ 'GROUP BY slotmast_id) as Amount '
+ 'WHERE #slotreport.slotmast_id = amount.slotmast_id;'
-- CI Pu PD
+ 'update #slotreport '
+ 'SET '+CAST (@VarMonth as VARCHAR)+'CIPUPD = amount.total '
+ '/ '+CAST (@DateDays as VARCHAR)+''
+ 'FROM (SELECT slotmast_id, isNull(SUM(ElecCoinIn), ''0'') as total '
+ 'FROM BB_REVENUE '
+ 'WHERE period_id = ''4'' and auditdate between '''+convert(varchar(11),@BeginDate,121)+''' and '''+convert(varchar(11),@EndDate,121)+''' '
+ 'GROUP BY slotmast_id) as Amount '
+ 'WHERE #slotreport.slotmast_id = amount.slotmast_id;'
SET @loopVar = @loopVar + 1
EXEC (@sqla)
--SELECT (@sqlb)
EXEC (@sqlb)
END
select * from #slotreport (nolock)
|
Advertisement
| Hall of Fame |