Viewing 15 posts - 1,291 through 1,305 (of 1,494 total)
Your question and query are extremely confused.
It looks as though you need to extract FillerOrderID from ReasonText in order to count the number of people associated with each one. This...
February 19, 2007 at 10:26 am
If you are not worried about which secondary email to get, then the following will be better:
SELECT T1.ID_Candidate, T1.MailAddress
FROM @t T1
WHERE T1.PrimaryAddress = 1
UNION ALL
SELECT T2.ID_Candidate, MIN(T2.MailAddress)
FROM @t T2
WHERE NOT...
February 19, 2007 at 8:28 am
I am not quite sure what you want but the following may help you:
-- *** Test Data ***
DECLARE @t TABLE
(
ID_MailAddress int NOT NULL PRIMARY KEY
,ID_Candidate int NOT NULL
,MailAddress varchar(255) NOT NULL
,PrimaryAddress...
February 19, 2007 at 7:32 am
@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
Viewing 15 posts - 1,291 through 1,305 (of 1,494 total)