Viewing 15 posts - 1,366 through 1,380 (of 2,452 total)
try this....based on your sample data (I think)
WITH rt_cte as (
SELECT a.[WK NO],
AC= MAX(AC),
comp= MAX(COMP),
AUSD= SUM(CASE WHEN SOA_TYPE = 'Agent' THEN USD_AMOUNT ELSE 0 END),
FUSD= SUM(CASE WHEN SOA_TYPE...
July 2, 2014 at 9:48 am
try this.....
with cte as (
SELECT ID
, COUNT(*) AS cnt
, MIN(orderdate) mind
, MAX(orderdate) AS maxd
FROM #TEMP
GROUP BY ID)
SELECT cte.ID
, t2.Orderamt AS CurrentAmt
, t1.Orderamt AS PreviousAmt
FROM cte
INNER JOIN #TEMP AS t1
ON cte.ID...
July 2, 2014 at 3:00 am
based on Lynn's previous code...I think the performance can be improved ... comments in the code
test script:...about 20secs and hopefully provides a test sample that imitates your real world
IF...
July 1, 2014 at 3:27 pm
Lynn Pettis (6/29/2014)
I'd try...
July 1, 2014 at 2:45 pm
It is a bit more complicated because of the rules given by customers ..........
I think it would help us if you could explain the "rules" of your "application management planning...
June 29, 2014 at 9:35 am
J Livingston SQL (6/24/2014)
a.guillaume (6/23/2014)
hi,To calculate the hours and lack of presence it takes 15 minutes
can you share the code you are running that takes 15 minutes?,,...having a better insight...
June 25, 2014 at 1:57 pm
a.guillaume (6/23/2014)
hi,To calculate the hours and lack of presence it takes 15 minutes
can you share the code you are running that takes 15 minutes?,,...having a better insight of what is...
June 24, 2014 at 3:12 pm
a.guillaume (6/22/2014)
ARNAUD should be approved absent from 12:00 p.m. to 1:00 p.m. (lunch?)
but actually absent from 11:45 a.m. to 1:15 p.m.....
so therefore he was AWOL(!) 11:45am to 12:00 pm and...
June 23, 2014 at 10:57 am
Jeff Moden (6/21/2014)
a.guillaume (6/19/2014)
He can't work on
00-8:00
12:00 p.m. to 1:00 p.m.
10:00 p.m. to...
June 21, 2014 at 2:56 pm
Currently we have calculations that work but take time: 15mn but it will take 1 hour at the end of the year ...
had a longer look at this...but cant resolve...
June 21, 2014 at 12:46 pm
can we assume that if [Resource_ABSENCE].[Id_Raison_absence] = 1 then the user is absent all day and therefore .... Théo minus absence = 0
June 21, 2014 at 10:02 am
a.guillaume (6/19/2014)
2013-12-09 450 ...
June 20, 2014 at 2:46 am
a.guillaume (6/19/2014)
this script contains one exampleRegards
Arno
thanks for the script...can you please confirm what results you are expecting from this data...just take a single day as an example
thanks
June 19, 2014 at 4:08 am
can you please supply table create / sample data insert scripts and the expected results for the sample data.
pls try and cover all eventualities .....eg do some people work overnight...
June 19, 2014 at 1:44 am
Viewing 15 posts - 1,366 through 1,380 (of 2,452 total)