Viewing 15 posts - 2,281 through 2,295 (of 4,087 total)
I think that this is what you are looking for.
SELECT *, ROW_NUMBER() OVER(PARTITION BY Companyid, DateFrom ORDER BY DateTo DESC)
FROM #temp
ORDER BY CompanyID, DateFrom, DateTo
Drew
October 7, 2016 at 8:12 am
That's XML. You should be using the built-in XML functionality to shred the XML document. If you provide a more complete sample, we can help you with that.
Drew
October 7, 2016 at 8:01 am
Jeffery Williams (10/6/2016)
October 6, 2016 at 5:33 pm
Jeffery Williams (10/6/2016)
Basically I need to see if records exist that matches a...
October 6, 2016 at 4:07 pm
Simply replace the periods with something else before replacing the greater than sign with a period. It's up to you whether you restore the periods after the PARSENAME.
Drew
October 6, 2016 at 3:23 pm
Have you tried Scott's approach?
I also want to add that this violates 2nd Normal Form. Have you considered how you want to handle it when one of the codes gets...
October 6, 2016 at 1:47 pm
valeryk2000 (10/5/2016)
October 6, 2016 at 8:39 am
Hugo Kornelis (10/5/2016)
drew.allen (10/5/2016)
With my first article for SSC accepted for publishing, I've already written a second (unrelated) article. I'd like to have a couple of people review it.
What...
October 5, 2016 at 8:16 pm
How about just changing the declaration of @StartTime2 to SMALLDATETIME?
Drew
October 5, 2016 at 3:52 pm
Luis Cazares (10/5/2016)
Drew, congratulations on the article. I usually write the articles in Word and share them that way before publishing, then just copy and paste in the site.
Thanks! I...
October 5, 2016 at 3:12 pm
With my first article for SSC accepted for publishing, I've already written a second (unrelated) article. I'd like to have a couple of people review it.
This article is meant...
October 5, 2016 at 2:26 pm
Sean Lange (10/5/2016)
drew.allen (10/5/2016)
And now we're getting blatantly fraudulent spam. :angry:
Is there any other kind? 😛
Whatever the spam was it didn't last very long as I can't see it at...
October 5, 2016 at 2:21 pm
And now we're getting blatantly fraudulent spam. :angry:
October 5, 2016 at 1:10 pm
It's really hard to provide suggestions without sample data and expected results based on that sample. (See the first link in my signature about how to provide that.)
The main...
October 5, 2016 at 1:06 pm
Viewing 15 posts - 2,281 through 2,295 (of 4,087 total)