Viewing 15 posts - 1,276 through 1,290 (of 1,472 total)
christophe.bernard (10/23/2008)
where condition in (CAST(int), @PostionsList)Christophe
I just went back and re-read this thread, and realized that we might all be overthinking this one. If all you want to do...
October 24, 2008 at 4:57 pm
Ahhhh. I get it. I QUIT... but I get it. (I don't even understand that commercial and I just used it. :ermm: )
So... to summarize:...
October 24, 2008 at 4:29 pm
rbarryyoung (10/24/2008)
select obitno, oaorsc
from hsdet inner join hshed on obhssq=oahssq
where oainvd>20050100
and convert(int,oaorsc)=@wh
The reason that this does not work is because the order that clauses appear in the WHERE section does...
October 24, 2008 at 4:04 pm
Yeah, and it'll still bug me until I figure out why it's not working. I thought it might have been similar to the tally issue from yesterday, but so...
October 24, 2008 at 3:26 pm
Lynn Pettis
select
obitno,
oaorsc
from
hsdet
inner join hshed
...
October 24, 2008 at 3:19 pm
Can you do this?
DECLARE @wh char(2)
SET @wh = '1'
SET @WH = CASE WHEN LEN(@WH) = 1 THEN '0' + @WH ELSE @WH END
select obitno, oaorsc
from hsdet inner join hshed on...
October 24, 2008 at 3:17 pm
What are the results of this:
SELECT DISTINCT oaorsc
FROM hsdet inner join hshed on obhssq=oahssq
where oainvd>20050100
If the list is reasonably short, post the whole thing.
October 24, 2008 at 3:05 pm
Lynn Pettis (10/24/2008)
October 24, 2008 at 2:28 pm
Did you try adding the AND ISNUMERIC(oaorsc) = 1 to your CTE?
There are many ways of accomplishing this, the key is finding the most efficient.
eg. Selecting only numeric rows...
October 24, 2008 at 1:59 pm
Nah, I just abuse my poor refresh button. (And have RSS feeds to Trillian) 😎
October 24, 2008 at 1:49 pm
I wasn't saying to put ISNUMERIC into your original query, only to check that all data above that breakpoint of 20050100 WAS numeric. (IE. Run that select and see...
October 24, 2008 at 1:38 pm
This isn't necessarily the problem, but for arguments sake, run this:
SELECT *
FROM hsdet inner join hshed on obhssq=oahssq
where oainvd>20050100 AND NOT ISNUMERIC(oaorsc) = 1
October 24, 2008 at 1:04 pm
Did you test that Source wasn't a table? :hehe:
Do you mean this?
SELECT COALESCE(A.ID, B.ID)
FROM TableA A
FULL OUTER JOIN TableB B ON A.ID...
October 24, 2008 at 12:58 pm
My original post assumed a starting table, which is what "Source" intended to represent. It wasn't intended to be literal ;).
P.S. Barry, that Select is messed up.
October 24, 2008 at 12:42 pm
Jeff Moden (10/24/2008)
ggraber (10/24/2008)
Jeff Moden (10/24/2008)
ggraber (10/24/2008)
P.S. You may want to read Jeff's cool article on Running Totals which explains how this approach works http://www.sqlservercentral.com/articles/Advanced+Querying/61716/
Heh... that's where I was going...
October 24, 2008 at 12:00 pm
Viewing 15 posts - 1,276 through 1,290 (of 1,472 total)