Author |
Topic |
jrockfl
Posting Yak Master
223 Posts |
Posted - 2004-07-18 : 08:33:50
|
This query returns all the rows from ARSLMFIL_SQL, how can I return the rows that are NOT IN ('web', '114') ?SELECT A.Slspsn_No, A.Slspsn_Name, B.callsout, C.callsinFROM ARSLMFIL_SQL A LEFT OUTER JOIN (SELECT COUNT(calllog.TTID) AS callsout, TTExt FROM calllog WHERE calllog.TTDirection = 2 GROUP BY TTExt) B ON A.Slspsn_No = B.TTExt LEFT OUTER JOIN (SELECT COUNT(calllog.TTID) AS callsin, TTAgtRngLst FROM calllog WHERE calllog.TTDirection = 1 GROUP BY TTAgtRngLst) C ON A.Slspsn_No = C.TTAgtRngLst |
|
Kristen
Test
22859 Posts |
Posted - 2004-07-18 : 08:59:37
|
You didn't say which column, but if its in ARSLMFIL_SQL then just addWHERE MyColumn NOT IN ('web', '114')to the bottom |
|
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2004-07-18 : 09:34:57
|
Thank you! it worked. It just looked kinda funny to me, because it is coming after a GROUP BY. I guess that last GROUP BY is in the C subquery so it will affect the entire query.How long have you been doing this stuff for? |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-07-18 : 10:15:46
|
quote: Originally posted by jrockflHow long have you been doing this stuff for?
SELECT CONVERT(varchar(20), DATEDIFF(Year, DATEADD(Day, 0, 28489), GetDate())) + ' years ' + CONVERT(varchar(20), DATEDIFF(Month, DATEADD(Year, DATEDIFF(Year, DATEADD(Day, 0, 28489), GetDate()), DATEADD(Day, 0, 28489)), GetDate())) + ' months ' + CONVERT(varchar(20), DATEDIFF(Day, DATEADD(Month, DATEDIFF(Month, DATEADD(Year, DATEDIFF(Year, DATEADD(Day, 0, 28489), GetDate()), DATEADD(Day, 0, 28489)), GetDate()), DATEADD(Year, DATEDIFF(Year, DATEADD(Day, 0, 28489), GetDate()), DATEADD(Day, 0, 28489))), GetDate())) + ' days' |
|
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2004-07-18 : 10:25:46
|
wow! thats very impressive! Thank you for all your help. |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-07-18 : 10:33:19
|
my pleasure |
|
|
|
|
|