Viewing 15 posts - 556 through 570 (of 4,086 total)
I don't see anything that requires an UNPIVOT. What are your expected results?
Are you trying to create an EAV table? That's highly discouraged.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 2, 2019 at 5:36 pm
During original and followup posts, the checkbox for “Notify me of follow-up replies via email” should default to being checked. Most people (especially newbie original posters) want to be...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 2, 2019 at 2:54 pm
I can use cast/convert to change data type of column while doing pivot/unpivot. Can above solution is feasible?
It's a BAD idea and you really need to have a compelling reason...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 2, 2019 at 2:40 pm
The old forum used to BOLD threads that had unread posts/replies and it also had a link to take you directly to the last unread post. It's much harder to...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 2, 2019 at 2:26 pm
I'm seeing bullets now.
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 2, 2019 at 2:24 pm
Something like the following:
SELECT *, DATEDIFF(HOUR, LAG(attendance_date) OVER(PARTITION BY EmployeNo ORDER BY a.attendance_date), attendance_date)
FROM #tmp_employees
CROSS APPLY ( VALUES( CASE WHEN Attendence = 1 THEN [Date] END )...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 2, 2019 at 2:20 pm
You've been around long enough to know that that's not the way to present data. You need to supply a script that will create a (temp) table or declare a...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 2, 2019 at 2:05 pm
For clarification, a SQL column does not have to be all the same type: SQL has a type of sql_variant that is designed to handle different data types in...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 1, 2019 at 10:37 pm
It's not fixed. I'm using Chrome (73.0.3683.86), and it doesn't show the bullets or the indentation. I also checked IE (11.592.17134.0) and it doesn't show the bullets, but it does...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 1, 2019 at 10:03 pm
Joe, Suppose that on SQL server we have 5 databases. When a schema groups database objects, do all those objects have to be within the same database? Or can...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 1, 2019 at 7:38 pm
I posted something with a bulleted list, and it didn't retain the bullets. I tried converting to use the BBCodes for ul/li, and it still didn't work.
Also, there doesn't seem...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 1, 2019 at 5:53 pm
A database is not a spreadsheet. You can't do a simple transpose like you can in Excel.
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 1, 2019 at 4:40 pm
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 28, 2019 at 3:38 pm
I think this will work, but it is COMPLETELY UNTESTED. I took out one of your ISNULLs, because I don't think it is necessary with this change, and I also...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 26, 2019 at 3:20 pm
Why do you believe that SSMS is treating it as a date time? I see no reason that it should. It would help if you can give us some sample...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 26, 2019 at 3:02 pm
Viewing 15 posts - 556 through 570 (of 4,086 total)