Viewing 15 posts - 9,826 through 9,840 (of 10,144 total)
Hi Pop
SELECT a.casenum, a.audit_date, c.audit_date as StartDate, a.stepname
...
July 1, 2008 at 10:57 am
So you want the cases having their most recent step in your list of stepnames? Sorry to be a pain!
July 1, 2008 at 10:41 am
Cool, many thanks Pop.
Got a question for you:
SELECT ...
July 1, 2008 at 9:16 am
Oh all right then. No funny stuff either.
DECLARE @ItemID INT
DECLARE @FirstCol varChar(5), @SecondCol INT, @ThirdCol Char(1)
SET @ItemID = 1
UPDATE #Testing SET ThirdCol = CASE @ItemID WHEN 1 THEN 'D'...
July 1, 2008 at 8:05 am
Hi Tim
I use the ASCII function for this, usually the first two characters of the column...
DECLARE @tempvar VARCHAR(5)
SET @tempvar = CHAR(10) + CHAR(13)
SELECT ASCII(LEFT(@tempvar,1)), ASCII(SUBSTRING(@tempvar,2,1))
Cheers
ChrisM
July 1, 2008 at 7:18 am
Shaun McGuile (7/1/2008)
...so all that is left is a table full of records which were duplicated at least once!
Misleading title though....;)
Jeff, Chris; It falls...
July 1, 2008 at 7:10 am
lmarcum (7/1/2008)
It is not impossible. Add an identity column. Each record will be numbered. Then use the identity column to delete the duplicate records.
Read the OP's second...
July 1, 2008 at 6:54 am
Jeff Moden (7/1/2008)
July 1, 2008 at 6:52 am
Pop
Your sample data doesn't return any rows. This chunk...
SELECT ...
July 1, 2008 at 4:09 am
mlando.mngomezulu (7/1/2008)
July 1, 2008 at 2:34 am
mlando.mngomezulu (7/1/2008)
Insert into temptable...
July 1, 2008 at 2:04 am
Nicking Barry's excellent idea (and Janines test data), here's another way which is quite fast:
DROP TABLE #Testing
CREATE TABLE #Testing (
FirstCol varChar(5),
...
June 30, 2008 at 10:28 am
Jeff Moden (6/26/2008)
Heh... no problem... if you think no coffee is bad, I'm trying to quit smoking... got anyone you want to take to a porkchop dinner? 😀
Ahah that explains...
June 27, 2008 at 4:56 am
Mark (6/24/2008)
SELECT
A.RetailerID,
X.RetailerIDTheirs
FROM TableA AS A
CROSS APPLY (SELECT TOP 1 B.RetailerIDTheirs FROM TableB B...
June 24, 2008 at 8:35 am
Hi Simon
This is simple but somewhat restrictive:
SELECT A.RetailerID, MIN(B.RetailerIDTheirs) AS RetailerIDTheirs
FROM #TableA A
LEFT JOIN #TableB B ON B.RetailerID = A.RetailerID
GROUP BY A.RetailerID
This is less simple but offers more flexibility:
SELECT...
June 24, 2008 at 8:30 am
Viewing 15 posts - 9,826 through 9,840 (of 10,144 total)