Viewing 15 posts - 346 through 360 (of 1,217 total)
I tried to generate the enviroment from what you posted and this is the result... can not guarantee that it works well in all situations.
/*environment for testing*/
create table [OPS Sepia$Extended...
August 21, 2007 at 3:58 am
I think that your problem is in the fact that you don't have clearly defined requirements. Maybe if you try to describe in words what precisely should be returned in...
August 21, 2007 at 3:33 am
Hmm... why shouldn't it work correctly? If by intersection you mean that the value is present in all tables, then it shouldn't make any difference in which order you look...
August 10, 2007 at 9:13 am
Search string has to be split into words, but these words can be searched within one statement with AND or OR, as appropriate.
SELECT product_id
FROM products
WHERE description LIKE '%screen%' OR description...
August 10, 2007 at 9:01 am
No, not with this type of CASE statement. It could be done like this:
SELECT CASE
WHEN RowNum IN(1, 10)...
August 10, 2007 at 8:32 am
Does the procedure use some parameters? When running the code as a script, are you replacing these parameters with hardcoded values? If yes, look up "parameter sniffing" on these forums......
August 9, 2007 at 1:27 am
When I cut out part of the code in green (+declarations), the result was what you consider correct result - i.e. addition occurred. If we are to find the source...
August 7, 2007 at 4:29 am
Hi,
I don't understand it fully yet - will try to look into it later - but there is one thing that's strange:
First, you declare variables as VARCHAR
@CardNmbr as varchar(9)
Declare @day...
August 7, 2007 at 4:10 am
You can delete the post yourself. Just click "Edit Post" and then instead of editing use "Delete Post" button. (Actually, I never tried that with an original post, only with...
August 6, 2007 at 1:36 am
You're welcome... mostly I only write comments when the query is finished, and I wasn't sure whether I understood the requirements or not, so I didn't comment it at all....
August 3, 2007 at 3:52 am
And a more general version, handy when you need to achieve given length, but have to add variable number of leading zeroes to do it.
DECLARE @Zips TABLE (ZipCode varchar(10))
SET NOCOUNT...
August 3, 2007 at 3:39 am
Just being curious - which of the solutions did you choose, mine or Koji's? And which performs better on your real data?
August 3, 2007 at 3:20 am
Well, if the problem was only in the desired result or in the sample data, then all is OK. Let me know whether my code works.
BTW, I forgot to post...
August 3, 2007 at 3:07 am
Hm.. but 2007-08-02 11:18:21.967 is GREATER than 2007-08-02 11:18:11.967 !! So that means matchID 2 should have no match, not matchID 3.
August 3, 2007 at 2:50 am
This gives the required result as I understood it from description - it differs where the posted desired result does not follow the rules of description (see previous post).
SELECT COALESCE(X.transdate,...
August 3, 2007 at 2:48 am
Viewing 15 posts - 346 through 360 (of 1,217 total)