Viewing 14 posts - 1 through 14 (of 14 total)
SQLBill (12/8/2015)
Someone posts code that works but might not be the best way (me) and then others follow-up with their suggestions. No...
December 8, 2015 at 7:33 pm
J Livingston SQL (6/30/2015)
google will be your friend if you are not sure how...
June 30, 2015 at 5:02 am
Jason A. Long (6/29/2015)
skilly2 (6/29/2015)
This solution worked as well. It works well with a small number of rows, but I don't think is easy as the above solution to...
June 29, 2015 at 10:00 pm
pietlinden (6/27/2015)
SELECT Null, Null, Null
FROM Tally
WHERE n<=@NumRows
you would need to figure out the count of missing rows to do it, but that would...
June 29, 2015 at 6:29 pm
Eirikur Eiriksson (5/11/2015)
skilly2 (5/11/2015)
May 11, 2015 at 4:47 pm
After reading Scott's reply, I further simplified the code to: IF (DATEPART(MINUTE,GETDATE()) BETWEEN 00 AND 04
OR DATEPART(MINUTE,GETDATE()) BETWEEN 30 AND 34)
AND OBJECT_ID('tempdb..#tmpClosedPOs') IS NOT NULL
I had to change it to...
May 11, 2015 at 4:42 pm
Thanks Andrew! I didn't realize I could use DatePart directly in the IF statement. For some reason I was thinking I had to somehow get it into a...
May 11, 2015 at 4:36 pm
Jeff Moden (4/13/2015)
http://www.sqlservercentral.com/articles/T-SQL/63681/
As a bit...
April 14, 2015 at 8:49 am
yb751 (4/13/2015)
Try using the CASE statements in the top level SELECT.
This is what I ended up doing. I just wasn't sure what aggregate to use for the PIVOT portion...
April 14, 2015 at 8:42 am
This worked perfectly! I'm still trying to wrap my head around it though. I understand what the Over (Partition statement does normally, but I've never used the Rows...
March 26, 2015 at 8:22 pm
Thanks for the compliment on the sample and explanation... However, I still didn't explain it 100% correctly :-). The query you gave is exactly what I asked for, but...
June 27, 2014 at 9:10 am
Sorry about leaving the specifics of the group out. Before submitting, I read my post and it made sense to me - of course. Sorry I missed the...
June 25, 2014 at 4:19 pm
Lynn, I was just putting together the sample DDL for creating the tables and sample data as Sean suggested, when I saw your post come through. Your post is...
June 23, 2014 at 2:05 pm
Sorry my post wasn't very clear. Each audit needs to have someone assigned to complete the audit. I'd like to assign the next employee in our employee table...
June 23, 2014 at 12:36 pm
Viewing 14 posts - 1 through 14 (of 14 total)