Viewing 15 posts - 1,246 through 1,260 (of 1,923 total)
Eugene Elutin (8/16/2010)
Personally, I wouldn't use UDF for the requested task, even it's look neater, it will be slower than just doing it in-line....
Eug, I knew you guys will hate...
August 16, 2010 at 6:58 am
Or even betters solution:
Functions Script:
IF OBJECT_ID (N'dbo.iTVF_GetStringBetween2Chars', N'IF') IS NOT NULL
BEGIN
PRINT 'FUNCTION : dbo.iTVF_GetStringBetween2Chars ALREADY PRESENT, SO DROPPING IT..'
DROP FUNCTION dbo.iTVF_GetStringBetween2Chars;
PRINT 'CREATING FUNCTION : dbo.iTVF_GetStringBetween2Chars'
END
ELSE
BEGIN
PRINT 'FUNCTION : dbo.iTVF_GetStringBetween2Chars IS...
August 16, 2010 at 6:28 am
WOW.... THIS IS MY 1000th POST... HAPPPY ME!! :w00t: :cool::cool:
Take this brother:
IF OBJECT_ID (N'dbo.udf_GetStringBetween2Chars', N'FN') IS NOT NULL
BEGIN
PRINT 'FUNCTION : dbo.udf_GetStringBetween2Chars ALREADY PRESENT, SO DROPPING IT..'
DROP FUNCTION dbo.udf_GetStringBetween2Chars;
PRINT 'CREATING FUNCTION...
August 16, 2010 at 6:06 am
It can be done quite easily.. But we need ready to use data to start working on it..
please go through this following article and help us help you!
August 11, 2010 at 8:20 am
So confusing the requirement is, bryant!
Can u please elaborate ?
As a side note, include the status column along with the driver ID in the Group BY dint solve your request?
We...
August 11, 2010 at 8:13 am
You have come this far, why not go one step further and post some DDL and DMLs for your request . Please go through the following article on how to...
August 11, 2010 at 5:22 am
LutzM (8/11/2010)
ColdCoffee (8/10/2010)
LutzM (8/10/2010)
@ColdCoffee
:Sorry for sending you in the wrong direction!
Not at all, Lutz. I already coded the sample data with IDENTITY column , so that i will get a...
August 11, 2010 at 5:07 am
drew.allen (8/10/2010)
ColdCoffee (8/10/2010)
INNER JOIN will fail with the following sample data :A CROSS JOIN with a WHERE clause that references both tables is essentially the same as an INNER JOIN
Drew
True,...
August 11, 2010 at 3:36 am
Something like this ?
declare @test-2 table
(code varchar(2) not null,
Rate varchar(10) not null,
Stardate datetime Not nUll,
Enddate datetime Null,
Importdate datetime null)
INsert iNTO @test-2 VAlues( 1 ,4200,'2004-01-01',Null,null)
INsert iNTO @test-2 VAlues(...
August 11, 2010 at 3:10 am
LutzM (8/10/2010)
I guess the Row_Number approach I was hitting for was overdesigned for the task...
You're absolutely right, for the given task a simple join on the time columns would be...
August 10, 2010 at 11:08 pm
drew.allen (8/10/2010)
August 10, 2010 at 10:58 pm
And i had another post form another dude asking exactly the same question... i dont remember that post.. probably u can find more explanations and code in that as well...
August 10, 2010 at 11:29 am
If you dont have an ID column, then as Lutz suggested, use ROW_NUMBER as given below.
declare @tab table
(
rid int identity(1,1),
starttime datetime,
endtime datetime
)
insert into...
August 10, 2010 at 11:27 am
Sagar, try this:
declare @tab table
(
rid int identity(1,1),
starttime datetime,
endtime datetime
)
insert into @tab
select '2010-08-10...
August 10, 2010 at 11:24 am
Aspg (8/10/2010)
I dont have identity column in the table
Why not an IDENTITY column or even an ID column to mark rows ... hmmm.. anyways, take this ; this uses...
August 10, 2010 at 6:28 am
Viewing 15 posts - 1,246 through 1,260 (of 1,923 total)