Viewing 15 posts - 3,196 through 3,210 (of 4,085 total)
SSMS is a UI built to work with T-SQL. It is not part of T-SQL. Text mode and grid mode are functions of the UI itself, not native...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 24, 2012 at 8:21 am
CHARINDEX() has an option parameter (start_location) that can be used to skip the first occurence of the specified string. If you want an example, you'll have to provide more...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 23, 2012 at 12:39 pm
Please don't hijack old threads. If you have a new question, start a new thread.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 20, 2012 at 6:32 pm
polkadot (4/20/2012)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 20, 2012 at 6:29 pm
polkadot (4/20/2012)
Dwains does pretty much exactly what needs to be done even with the additional business rules, with the exception that it errors in two places:
The problem with Dwain's code...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 20, 2012 at 3:54 pm
polkadot (4/20/2012)
please explain how 'Days' is introduced. Since you and Dwain are both using DATEDIFF to extract
day portion of the datetime, I would have expected your CASE statements...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 20, 2012 at 3:44 pm
There is a third option. Update the rows in Table2 so that the constraint will still be valid after the delete. You can either update that column to...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 20, 2012 at 11:46 am
Check out Jeff Moden's article Cross Tabs and Pivots, Part 1 – Converting Rows to Columns[/url]
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 20, 2012 at 9:46 am
polkadot (4/20/2012)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 20, 2012 at 9:31 am
abs1337 (4/20/2012)
and I get this error "The select list for the INSERT statement contains fewer items than the insert list. The number of...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 20, 2012 at 8:39 am
Sorry about the error in my code. I forgot to copy the entire code.
Here is an update with changes to provide an average rather than a count. The...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 20, 2012 at 7:27 am
You're looking for the HAVING clause.
SELECT SerialNum, MAX(UsedDate) AS LastUsedDate
FROM YourTable
GROUP BY SerialNum
HAVING MAX(UsedDate) < DATEADD(YEAR, -1, GETDATE())
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 19, 2012 at 2:25 pm
dwain.c (4/18/2012)
,ROW_NUMBER() OVER (PARTITION BY Case_ID, PPL_Area, Review_Status
ORDER BY Case_ID, PPL_Area, Review_Status, Revision DESC) As rk
I only quoted the relevant section of the code.
By definition, the partitioning fields are...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 19, 2012 at 2:03 pm
I'm getting different results from Dwain for one of the records. He has WA_Traffic in a Proposed Status for <30 days, but I'm getting 30-60 days.
Here is how I...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 19, 2012 at 1:58 pm
polkadot (4/19/2012)
drew. will you please elaborate the 'certain circumstances'?I shall venture to disagree with that statement under certain circumstances.
That was a quote of Dwain.C. He mentions some of...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 19, 2012 at 11:15 am
Viewing 15 posts - 3,196 through 3,210 (of 4,085 total)