Viewing 15 posts - 1,456 through 1,470 (of 3,957 total)
ccavaco (9/19/2013)
SELECT
AlternateName = CASE WHEN AlternateName = ' ' AND AlternateName1 <> ' '
THEN AlternateName1 WHEN AlternateName = ' ' AND...
September 19, 2013 at 7:34 pm
Avoiding DISTINCT and perhaps a little simpler logic is:
SELECT TransactionNumber
FROM (
SELECT TransactionNumber, CancelDueToCorrection
,rn=ROW_NUMBER() OVER (PARTITION BY TransactionNumber ORDER...
September 19, 2013 at 7:28 pm
PatternSplitCM (see the 4th article in my signature links) is a high performance tool to facilitate tasks such as this one. Makes the code look pretty simple too.
WITH SampleData...
September 19, 2013 at 7:15 pm
marlon.seton (9/19/2013)
dwain.c (9/18/2013)
marlon.seton (9/18/2013)
ProivWe develop one code set for Windows, Sun & Linux with Oracle, then have to tweak it a bit to for Windows & SQLServer.
Thanks! From your...
September 19, 2013 at 12:57 am
ChrisM@Work (8/28/2013)
SELECT
col1 = MIN(CASE WHEN t.value = x.min_value THEN value ELSE NULL END),
col2 = MIN(CASE WHEN t.value = x.min_value THEN t_stamp ELSE NULL END),...
September 18, 2013 at 11:45 pm
Jeff Moden (9/18/2013)
Sean Lange (9/18/2013)
September 18, 2013 at 8:35 pm
mickyT (9/18/2013)
dwain.c (9/18/2013)
WITH SampleData (MyStr) AS (
SELECT 'Ørstedsvej 7B' UNION ALL
SELECT 'Volvo 25D' UNION ALL
SELECT '104ND Nokia'
)
SELECT MyStr
...
September 18, 2013 at 8:19 pm
I believe that if you're exclusion date ranges do not overlap, you may also be able to do it like this:
SELECT OrderID,[MaxNonExclusionDays]=MAX([NonExclusionDays])
FROM (
SELECT OrderID, GapStart=MIN(GapDates),...
September 18, 2013 at 7:59 pm
How about using a string pattern splitter?
WITH SampleData (MyStr) AS (
SELECT 'Ørstedsvej 7B' UNION ALL
SELECT 'Volvo 25D' UNION ALL
SELECT '104ND Nokia'
)
SELECT MyStr
...
September 18, 2013 at 7:24 pm
Yet another way using Jeff Moden's venerated delimited string splitter: DelimitedSplit8K[/url] (download at the link provided):
declare @MyValue varchar(1000) = '<NewOrder><InstID>ED</InstID><PatientID>22164</PatientID><LName>fACKSON</LName><FName>JAMES</FName><EntryID>1923236</EntryID><OrderID></NewOrder>'
SELECT LEFT(Item, PATINDEX('%[^0-9]%', Item)-1)
FROM (SELECT REPLACE(@MyValue, 'EntryID>', CHAR(5))) a(MyStr)
CROSS APPLY dbo.DelimitedSplit8K(MyStr,...
September 18, 2013 at 7:00 pm
Perhaps like this?
UPDATE a
SET MyTotUnis = ISNULL(
(
SELECT TOP 1 Units
FROM...
September 18, 2013 at 6:50 pm
marlon.seton (9/18/2013)
ProivWe develop one code set for Windows, Sun & Linux with Oracle, then have to tweak it a bit to for Windows & SQLServer.
Thanks! From your information it...
September 18, 2013 at 6:30 pm
marlon.seton (9/17/2013)
dwain.c (9/16/2013)
marlon.seton (9/16/2013)
September 17, 2013 at 11:04 pm
I see you accepted it now for publication. That's cool!
I noticed that I misspelled "Spackle" as "Spacklet" in the title. I hope you can correct that before publication.
I...
September 16, 2013 at 6:52 pm
Sean Lange (9/16/2013)
dwain.c (9/15/2013)
I don't recommend doing the REPLACE in the call to DelimitedSplit8K function. Even though that is an awesome tool, I've run into some unexpected performance issues...
September 16, 2013 at 6:29 pm
Viewing 15 posts - 1,456 through 1,470 (of 3,957 total)