Viewing 15 posts - 1,291 through 1,305 (of 1,491 total)
@myvar varchar(7999) --!! What made you think you could have a text parameter?
LIKE '%' + @myvar
or
LIKE '%' + @myvar + '%'
depending on what you want
February 16, 2007 at 6:15 am
You need to carry the RootIDs through the recursion. Something like:
DECLARE @t TABLE
(
TableID int NOT NULL PRIMARY KEY
,TableName varchar(20) NOT NULL
,ParentID int NULL
)
INSERT INTO @t
SELECT 1, 'PropertyGroup', NULL UNION ALL
SELECT...
February 16, 2007 at 3:02 am
I also have difficulty getting my head around this type of query.
The following may not be correct but seems to work on the data provided. There are probably better solutions.
DECLARE @t...
February 15, 2007 at 11:10 am
Maybe I am missing something, but to get results older than 2 days don't all these queries need a < instead of a >?
February 14, 2007 at 10:12 am
As you only want the totals for each row the query is, as Colin indicated, quite straigtht forward.
(Although it would be better if you normalized the table!)
Try:
SELECT distribuorid, selection1, selection2,...
February 14, 2007 at 5:03 am
The following links may help:
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=19&messageid=340622
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=19&messageid=335798#bm336118
February 14, 2007 at 4:30 am
Your question is somewhat confusing. It would help if you could give some sample data and the expected results.
February 14, 2007 at 4:02 am
Try declaring variables @WavPos and @MP3Pos and then replacing:
IF SUBSTRING(@ProductDescription, @EndPos + 2, 3) = @FileFormat
SET @valid = 1
IF (len(@ProductDescription) - @StartPos) > 19
IF SUBSTRING(@ProductDescription, @EndPos + 19, 3) =...
February 13, 2007 at 11:34 am
This should take into account your extra data:
SELECT YourCol
FROM YourTable
ORDER BY
LEFT(YourCol, PATINDEX('%[0-9]%', YourCol) - 1)
,CAST(SUBSTRING(YourCol, PATINDEX('%[0-9]%', YourCol), 3) AS int)
February 13, 2007 at 8:15 am
Try something like:
SELECT YourCol
FROM YourTable
ORDER BY
LEFT(YourCol, 2)
,CAST(SUBSTRING(YourCol, 3, 3) AS int)
February 13, 2007 at 7:01 am
If you only have two dates per month, something like the following should work:
SELECT T1.[Date]
,T1.Value - T2.Value AS Value
FROM YourTable T1
JOIN YourTable T2
ON T2.[Date] < T1.[Date]
AND YEAR(T1.[Date]) = YEAR(T2.[Date])
AND MONTH(T1.[Date])...
February 13, 2007 at 6:19 am
The lack of test data and results, along with the mix of old and new style join syntax, makes it difficult to guess what is going on here. I suspect...
February 12, 2007 at 10:39 am
SELECT *
FROM YourTable
ORDER BY
CASE Code
WHEN 1 THEN 'ZZZZZ' -- larger than MAX(ACCT)
ELSE Acct
END
,Amount DESC
February 10, 2007 at 7:09 am
>> what sort of perf improvement do you expect from this change?
One thing I have noticed is that, if a SQL collation sequence is used, comparison operations, especially LIKEs, are...
February 9, 2007 at 11:20 am
How about:
SELECT *
FROM YourTable
ORDER BY
CASE Code
WHEN 1 THEN 10000 -- larger than MAX(ACCT)
ELSE Acct
END
,Amount DESC
February 9, 2007 at 10:58 am
Viewing 15 posts - 1,291 through 1,305 (of 1,491 total)