Viewing 15 posts - 2,296 through 2,310 (of 8,731 total)
whereisSQL? (8/15/2016)
Revenant (8/15/2016)
Ray K (8/15/2016)
Ed Wagner (8/15/2016)
djj (8/15/2016)
Grumpy DBA (8/15/2016)
djj (8/15/2016)
Ed Wagner (8/15/2016)
SweetTreat
Trick
Joke
Puzzle
Jigsaw
Tools
Power
Unlimited
August 15, 2016 at 11:58 am
That seems correct. Have you tried it?
August 15, 2016 at 11:57 am
Just a small changes based on preferences. I prefer to make the FROM clause as simple as possible, that's why I use CTEs instead of derived tables (same thing different...
August 15, 2016 at 11:32 am
Are you sure that you're querying the tables correctly?
You don't have alias for your tables and that might be causing to use the incorrect columns on what should be a...
August 15, 2016 at 9:25 am
You forgot the commas and to put brackets around your column names.
August 15, 2016 at 7:07 am
You can use a method called cross tabs (or the pivot operator) which is explained in here:
http://www.sqlservercentral.com/articles/T-SQL/63681/
Here's an example based on your greatly posted sample data.
SELECT ComputerID,
...
August 15, 2016 at 6:58 am
Just because this thread was revived after 9 years, I'd like to make a few suggestions.
Use parametrized dynamic sql and always define precision and scale for your types. In 2000,...
August 15, 2016 at 6:54 am
whereisSQL? (8/12/2016)
Ray K (8/12/2016)
Ed Wagner (8/12/2016)
Kaye Cahs (8/12/2016)
Ed Wagner (8/12/2016)
djj (8/12/2016)
FinalistWin
Doze
Coffee
Caffeine
Stimulant
Sugar
August 12, 2016 at 12:52 pm
Snargables (8/12/2016)
August 12, 2016 at 12:11 pm
ChrisM@Work (8/12/2016)
Steve Jones - SSC Editor (8/11/2016)
Part of the process noted that we have a few "how to post code, how to ask a question, how to format code" articles....
August 12, 2016 at 9:26 am
Jeff Moden (8/11/2016)
Luis Cazares (8/11/2016)
You might have some options to copy the table, but answer Eirikur's questions so we can...
August 12, 2016 at 7:12 am
What happens if you don't convert to time? Maybe you have some very long running process or transactions that were left open.
August 12, 2016 at 6:55 am
Check the following article for the best options on doing this in 2008 and previous versions.
http://www.sqlservercentral.com/articles/T-SQL/68467/
If by any chance you're on 2012 or a more recent version, a simpler option...
August 11, 2016 at 1:47 pm
SQLTestUser (8/11/2016)
Result For Hour
XXX38532962 which makes no sense as i just want to figure out how much time they spent, i.e. total time on the system in a way that...
August 11, 2016 at 12:37 pm
You're adding too many minutes. If that's correct, then cast as bigint before aggregating. If not, correct the formula.
SELECT UserID, Hours = SUM(CAST( DATEDIFF(MINUTE, '0:00:00', LogDatetime) AS bigint))
FROM dbo.TLog...
August 11, 2016 at 12:02 pm
Viewing 15 posts - 2,296 through 2,310 (of 8,731 total)