Viewing 15 posts - 1,501 through 1,515 (of 1,825 total)
Recursive CTE's are the way to go, have a quick google.
Feel free to post back with any further questions
September 11, 2009 at 2:56 am
Select top 1 * from rates where end_date >= Inputdate order by end_date
September 10, 2009 at 2:08 am
I think this is pretty close...
with cteWithGroup(id,Grouping)
as
(
Select Id,(Row_number() over (order by id)-1) /4
from #temp
)
,
cteRanges(MinId,MaxId,Grouping)
as
(
Select Min(id),Max(id),Grouping
...
September 10, 2009 at 2:06 am
How are you discriminating for the output ranges ?
Would the output of
'001 - 018', 'Missing: 003,009, 010,013, 016'
Be acceptable ?
If not, why not ?
----
EDIT : Dont worry , I...
September 10, 2009 at 1:39 am
Im i correct in guessing , next time please give more detail as others have suggested, that you want totals sales (or something) on a day by day / week...
September 10, 2009 at 1:32 am
Classic bad question. Feeling charitable though, ill take a stab at it.
http://www.sqlservercentral.com/Forums/Topic785337-1291-1.aspx
September 10, 2009 at 1:26 am
the table variable @table1 is not know within the scope of the dynamic SQL you are executing.
I assume you are doing it like this for the IN condition ?
Use the...
September 9, 2009 at 7:18 am
What is the specific error ?
September 9, 2009 at 6:25 am
You cant remove the time , since time is an integral part of a date time field.
But you can set it to midnight
SELECT DATEDIFF(DAY,0,@Date)
Is that any help ?
September 9, 2009 at 6:00 am
You should be using DRI ( Declarative referential integrity ) to do this.
Try this link http://www.nerdymusings.com/LPMArticle.asp?ID=34
September 9, 2009 at 5:17 am
Silverfox (9/9/2009)
If you had to make the distinction
Although IMO , its better to base the distinction on functional need. 🙂
If you NEED to trim trailing and leading spaces ,...
September 9, 2009 at 5:10 am
Then trim version is longer by an estimated 0.0000001 cpu cost.
Whats your real issue ?
September 9, 2009 at 5:00 am
Try this
declare @String varchar(255)
Select @String = 'dsasda@fff@ffff@';
with Nums(n)AS (
select top 100 percent number from
master..spt_values
where
TYPE='p' and number =1
order by...
September 9, 2009 at 4:57 am
There are a few ways , try this
drop table #t1
go
create table #t1
(
RowId integer,
ValueStr nvarchar(50)
)
go
insert into #t1 values(1,'1, 2 , 3,4')
insert into #t1 values(2,'4')
insert into #t1 values(3,'25,26,27,28,29,30,31,32')
insert into #t1 values(4,'2...
September 9, 2009 at 4:23 am
Viewing 15 posts - 1,501 through 1,515 (of 1,825 total)