Viewing 15 posts - 1,786 through 1,800 (of 2,171 total)
What about holidays?
Take a look at this article
http://www.sqlservercentral.com/columnists/plarsson/howmanymoremondaysuntiliretire.asp
declare @startdate datetime,
@enddate datetime,
@workdays smallint
select @startdate = '20070101',
@workdays = 10
select @enddate = dateadd(day, 3 + 1.4 * @workdays, @startdate)
January 30, 2007 at 12:30 am
select *
from @mytable
where row_number() over (partition by itemname order by itemvalue desc) = 2
order by itemname
January 22, 2007 at 1:44 am
Run this
select d.itemname,
max(x.itemno) as itemno,
d.qwerty
from (
select t1.itemname,
(select min(itemvalue) from (select top 2 t2.itemvalue from @mytable as t2 where t2.itemname = t1.itemname order by t2.itemvalue desc) as d) as qwerty
from @mytable as t1
 
January 22, 2007 at 1:37 am
January 22, 2007 at 1:12 am
update c
set c.col3 = d.qwerty
from tableA as c
inner join (
select a.col2,
count(b.idcol) as qwerty
from tableB as b
inner join tableA as a on a.idcol = b.idcol
group by a.col2
  as d on c.col2 =...
January 22, 2007 at 1:11 am
SELECT NULLIF(Col001, 'NULL') AS NewCol1,
NULLIF(Col002, 'NULL') AS NewCol2
FROM <YourTableNameHere>
January 10, 2007 at 4:55 am
You want just the date?
SELECT DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)
November 11, 2006 at 2:47 am
Using UNION ALL can potentially lead to duplicates, if both fieldA and fieldB contains the text "my".
Replace UNION ALL with UNION only to get correct result. But then the query...
November 7, 2006 at 10:27 pm
October 30, 2006 at 3:35 am
Something like
INSERT Target
SELECT PIN, <someothercolumns> FROM Source
UNION ALL
SELECT PIN, <someothercolumns> FROM Source
UNION ALL
SELECT PIN, <someothercolumns> FROM Source
October 30, 2006 at 3:28 am
http://www.connectionstrings.com
Also, there are massive information here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926
October 23, 2006 at 3:10 am
October 23, 2006 at 3:07 am
Fast generic solution posted here
http://www.sqlteam.com/forums/topic.asp?whichpage=2&TOPIC_ID=73610񀞄
October 18, 2006 at 7:57 am
Viewing 15 posts - 1,786 through 1,800 (of 2,171 total)