Viewing 15 posts - 91 through 105 (of 499 total)
I missed out the original grouping. :doze:
;WITH IntermediateQRY AS (
SELECT DR_DCATCD,
SUM(DR_DQTY)-SUM(POUT_QTY) AS IntermediateQTY,
SUM(DR_DQTY*DR_DUPRICE) AS AMT
FROM DRDTL
INNER JOIN
POUT_DTL
ON DRDTL.DR_DICODE=POUT_DTL.POUT_BC
WHERE DR_DDATE BETWEEN #6/1/2009# AND #6/30/2009#
AND DR_DSTORE IN('342','338','333','302','315','303','312','332','316','325','339','129','217','128')
GROUP BY DR_DCATCD
)
SELECT DR_DCATCD,
...
December 8, 2011 at 4:08 am
Try this
;WITH IntermediateQRY AS (
SELECT DR_DCATCD,
SUM(DR_DQTY)-SUM(POUT_QTY) AS IntermediateQTY,
SUM(DR_DQTY*DR_DUPRICE) AS AMT
FROM DRDTL
INNER JOIN
POUT_DTL
ON DRDTL.DR_DICODE=POUT_DTL.POUT_BC
WHERE DR_DDATE BETWEEN #6/1/2009# AND #6/30/2009#
AND DR_DSTORE IN('342','338','333','302','315','303','312','332','316','325','339','129','217','128')
GROUP BY DR_DCATCD
)
SELECT SUM(IntermediateQTY) AS QTY,
...
December 8, 2011 at 3:42 am
There are ways of joining the output of a stored procedure to another table. One way would be to use ##Temp tables
Another would be to use INSERT ... EXEC...
December 8, 2011 at 3:33 am
In SQL Server I get this error
Cannot perform an aggregate function on an expression containing an aggregate or a subquery.
So I would guess its not possible in Access either.
December 8, 2011 at 3:18 am
It depends what you want.
Do you want each session's data to be separate. If so use @Table variables or #Temp tables in the procedure - they are isolated to...
December 8, 2011 at 3:03 am
I think that volcanic air is getting to you Tom, This question is way over most of our heads - a really hard question. No amount of googling seemed...
December 8, 2011 at 2:44 am
Normally print formatting would not be done in the SQL. SQL would be used simply to select the data and another program would apply the print formatting to suit...
December 8, 2011 at 1:47 am
Bouben (12/7/2011)
December 7, 2011 at 4:15 am
First I got 53,30,1,32 - but soon realised you're using an ambiguous date format.
Thanks for the question:
Week 53 is quite a common occurrance where I work, so it...
December 7, 2011 at 2:21 am
Bouben (12/6/2011)
Tom Brown (12/6/2011)
December 7, 2011 at 2:08 am
For your assignment you need to replace the Oracle part
FOR Emp IN (SELECT * FROM Employee)
LOOP
WITH a CURSOR in SQL SERVER
DECLARE @EmpID INT;
DECLARE cur_Emp CURSOR FOR (SELECT Employee_ID FROM Employee)
OPEN...
December 6, 2011 at 7:51 am
In MSDB there are sysjobs and sysjobschedules tables.
I think there are others too. Search these names for examples of job schedule listings.
December 6, 2011 at 2:30 am
I had never heard of Nested Joins, so learned something today.
However my method of getting the right answer was to use the execution plans. One execution plan exactly matched...
December 6, 2011 at 2:21 am
Regardless of whether you should be using 4-digit PINs at all, Here is how I would approach the problem. Since there are only 10,000 possible PINs - I would...
December 5, 2011 at 6:18 am
Some hints to get you started.
Convert the PIN to text
Use CHARINDEX to compare "78901234567890123", see if the PIN is contained in that
Use a Tally Table to see if Char N+1...
December 5, 2011 at 5:17 am
Viewing 15 posts - 91 through 105 (of 499 total)