Viewing 15 posts - 91 through 105 (of 206 total)
I wasn't sure if the trailing 0 would actually be the last digit in the string or not. If it is then this can be simplified a lot. ...
September 4, 2009 at 10:35 am
jerseyeddiem (9/3/2009)
this is what...
September 3, 2009 at 2:47 pm
No clue if this is what you are asking for but it was the first thing that came to my mind.
CREATE TABLE #temp (test INT, test2 INT, data VARCHAR(10))
INSERT INTO...
September 3, 2009 at 2:07 pm
You can try the user_name() or suser_name() functions.
September 3, 2009 at 11:19 am
But if you are only wanting 1 row per itemID you could do something like this:
SELECT * FROM #tab1 a
WHERE endDate = (SELECT MAX(enddate) FROM #tab1 b WHERE a.ItemId =...
September 3, 2009 at 9:23 am
Sorry, what I had assumed too much. Are you sure your query isn't working?
I did this just to make sure and it worked fine.
create table #Tab1
(
ItemId int,
GroupID int,
endDate datetime
)
INSERT...
September 3, 2009 at 9:18 am
acogswell (9/3/2009)
I would like to start out by saying I...
September 3, 2009 at 8:00 am
No problem, glad it worked. Have fun with the remaining logic in your process. Sounds like it should be fun.
September 2, 2009 at 12:05 pm
instead of using a second table you could use the pivot function. this is what i came up with. i think it fits your requirements.
/*
Create Temp table #AGED1B...
September 2, 2009 at 11:30 am
SELECT create_date FROM sys.databases
WHERE NAME = 'TEMPDB'
EDIT: Sorry this will return the last time the SQL service was started.
September 1, 2009 at 2:00 pm
The rowNumber is determined based off the row_number() function and it will be in the order of whatever is specified by the order by clause of that function. So...
August 28, 2009 at 7:40 am
This is a simple way to start. You might have to adjust the logic to determine what row you want to be returned.
CREATE TABLE #temp (empid INT, empname VARCHAR(50),...
August 28, 2009 at 6:59 am
While you are at it go ahead and follow the top link in lynn's signature. Please post the DDL scripts and some sample data.
August 27, 2009 at 2:40 pm
This worked for me
DECLARE @test-2 VARCHAR(50)
SET @test-2 = 'http://xyz.com/customer/app1.asp'
SELECT REPLACE(@test, 'xyz.com','localhost')
August 27, 2009 at 2:29 pm
Yep, drew's is much nicer and it handles the logic correctly. I don't even know what I was thinking now that I have read through a much better implementation.
August 27, 2009 at 12:43 pm
Viewing 15 posts - 91 through 105 (of 206 total)