Viewing 15 posts - 1 through 15 (of 15 total)
This is even cleaner to me:
SELECT EmployeeName, EmployeeNo,
SUM(CASE WHEN DATEPART(dw,DateEnt)=1 THEN RegHours ELSE 0 END) AS SunRegHours,
SUM(CASE WHEN DATEPART(dw,DateEnt)=2 THEN RegHours ELSE 0 END) AS...
December 9, 2008 at 9:46 am
Garadin (12/9/2008)
Give this article a read.http://www.sqlservercentral.com/articles/T-SQL/63681/
The X is the derived table alias, doesn't have anything to do with the GROUP BY.
I'll give that link a look... I have...
December 9, 2008 at 9:33 am
Lowell (12/9/2008)
December 9, 2008 at 9:30 am
This was suggested by someone which works:
SELECT EmployeeName, EmployeeNo,
SUM(CASE WHEN dw=1 THEN RegHours ELSE 0 END) AS Sun_RegHours,
SUM(CASE WHEN dw=2 THEN RegHours ELSE 0 END) AS Mon_RegHours,
SUM(CASE WHEN dw=3 THEN...
December 9, 2008 at 9:24 am
Thanks for all the replies... I am testing both methods and trying to decide which way to go. Marshall, I had originally done it this way and wasn't sure...
April 24, 2006 at 8:26 am
Ok... I have the script.
Could you expand upon this example to where there are 2 search fields and it is possible for one or both to be selected.
I am trying...
December 17, 2001 at 12:18 pm
Paul,
I can't locate the script you are speaking of. Could you give me a link to it or post it here?
To all of you out there,
There have got to...
December 17, 2001 at 7:19 am
We are running on SQL7 with the latest service pack, but we plan to go to SQL2000 in a couple of months. There are about 23 fields in the...
December 13, 2001 at 6:29 am
Thanks for your time and input!
December 12, 2001 at 12:03 pm
Test... couldn't see my last post on the 2nd page of of posts... so placing another post to see if it will make it show up.
December 12, 2001 at 8:48 am
I think you write just fine... I am simply a very detail oriented person and try to not leave any guess work when I write technical documents... only because I...
December 12, 2001 at 8:41 am
Your going to hate me.
You didn't say how to get the DTS into a script format. How do you get that out?
Do you also generate...
December 11, 2001 at 1:14 pm
Oh... I forgot... do you include Generate Drop Object in your scripts.
December 11, 2001 at 10:51 am
I might have not been clear enough in my original post... I am at the point before even getting to in-flight or branching. I am still trying to figure...
December 11, 2001 at 10:42 am
Steve, thanks for the article. I have been looking for a way to track changes and this may just work for us. However I would like a little...
December 11, 2001 at 8:59 am
Viewing 15 posts - 1 through 15 (of 15 total)