Viewing 15 posts - 871 through 885 (of 1,923 total)
Yes, work out with REPLACE.. Like : REPLACE(column, ':','')
March 28, 2011 at 3:55 pm
hey timo, sorry couldnt get time to work on ur request, but seems like u figured it out yourself... thanks for the posting the final code, helps a lot of...
March 27, 2011 at 11:53 am
How can u find DIFFERENCE between 2 entities with just having one entity ? DATEDIFF requires 2 dates to find the diff... one date is the one u are currently...
March 27, 2011 at 2:05 am
Try this:
;with cte as
(
select *
from #DataModel2 pivot_Table
pivot
( max(analyticvalue) for AnalyticType in ([Analytic4],[Analytic5],[Analytic6])) pivot_handle
)
SELECT dm1.id, [Analytic1],[Analytic2],[Analytic3] ,[Analytic4],[Analytic5],[Analytic6]
from #DataModel1 DM1
inner join cte cte
on cte.id = dm1.ID
March 25, 2011 at 2:17 pm
Try this:
declare @UserDate DATETIME
select main.EID ,
MTD = ( select SUM(checkamount)
from table t_mtd
...
March 24, 2011 at 8:31 pm
Can you give us some MOCK-UP sample data to base our queries ?
March 24, 2011 at 8:21 pm
Try this:
DECLARE @Now DATETIME
SET @Now = GETDATE()
DROP Table #tmpDocSummary
; with cte as
(
select D1.ClientID , I1.*
, rn = row_number over(partition by d1.clientid order by I1.DocSummaryKey...
March 24, 2011 at 5:56 pm
Phil, why this?
and convert(varchar(10),I1.DateExpiry,120) >= convert(varchar(10),GetDate(),120)
Change that to:
DECLARE @Now DATETIME
SET @Now = GETDATE()
AND l1.DateExpiry = @Now
Secondly, can you explain your situation with some nice sample data and nice expected result?
March 24, 2011 at 5:52 pm
For each Badge and Site, will there be only 2 rows ?
March 22, 2011 at 10:57 pm
Try the ISDATE function.. something like:
delete from table where isdate(column) <> 1
March 21, 2011 at 7:42 pm
Best_boy26 (3/20/2011)
I am not looking for the highest value, I am looking to get from above rows (current row - 10 above rows) the highest value listed in what row...
My...
March 20, 2011 at 2:52 pm
Try this:
with cte as
(
select rn = ROW_NUMBER() over( order by (select null)) ,
i_c_o
from IC_Raw_In
)
, tiled as
(
select NT = NTILE(10) over (order...
March 20, 2011 at 1:22 pm
"JOIN" is what u are after 🙂
March 19, 2011 at 10:36 pm
LutzM (3/19/2011)
Here's a slightly different approach:
SELECT SUBSTRING(URLs,8,charindex('/',URLs+'/',8)-8) AS URLsFROM @URLTable
Smart Lutz!! I dint notice that the first occurance of the slash will always be at 8 🙁
Sloppy me...
March 19, 2011 at 3:39 pm
Try this:
DECLARE @URLTable TABLE
(
URLs VARCHAR(100)
)
INSERT INTO @URLTable
SELECT 'http://www.google.com/pages?=hh'
UNION ALL SELECT 'http://www.google.com'
UNION ALL SELECT 'http://www.google.com/vd/hhh/pages?=yy'
UNION ALL SELECT 'http://www.Adomain.com/pages?=hh'
UNION ALL SELECT 'http://www.Adomain.com'
UNION ALL SELECT 'http://www.Adomain.com/vd/hhh/pages?=yy'
SELECT SUBSTRING( URLs , INDEX_SLASH...
March 19, 2011 at 3:20 pm
Viewing 15 posts - 871 through 885 (of 1,923 total)