Viewing 15 posts - 46 through 60 (of 151 total)
From the hip:
SELECT DatePart(yyyy,period), DatePart(qq,period), Sum(Hours)
FROM EMP
GROUP BY DatePart(yyyy,period), DatePart(qq,period)
ORDER BY DatePart(yyyy,period), DatePart(qq,period)
COMPUTE Sum(Hours) BY DatePart(yyyy,period)
or without the COMPUTE with quarters first:
SELECTDatePart(qq,period),
DatePart(yyyy,period),
Sum(hours)
FROMdbo.emp
GROUP BYDatePart(YYYY,period),
DatePart(QQ,period)
Edit: added second option.
If you would like to...
July 23, 2008 at 1:34 pm
GSquared,
Apologies. I just noticed the OUTPUT in the actual call you posted.
SUCCESS!
Thank you all for your time and wattage.
--Sauron J. Terrill--
July 9, 2008 at 3:24 pm
As for CLR vs. xp_cmdshell:
I actually had this working in a manual sort of way in SSMS using xp_cmdshell. My current 'solution' is using a domain administrator equivalent to run...
July 9, 2008 at 3:17 pm
GSquared,
Yup. I took the code you provided (thank you!) and created a new sproc using your methods. I was hoping the nested SELECT at the end for the OUTPUT parameter...
July 9, 2008 at 3:11 pm
Jason,
Thank you for your reply. I have read the BOL entry for CREATE PROCEDURE, and have tried versions of this sproc both with and without OUTPUT parameters. I didn't really...
July 9, 2008 at 2:58 pm
Noeld,
I have tried the temporary table, but I tried it again anyway. Same results.
July 9, 2008 at 2:46 pm
I don't know of a function, but could you use the date the master database was created for each instance?
--SJT--
June 6, 2008 at 10:19 am
Agreed on all points, GSquared. Thanks for putting in the effort to clarify.
May 20, 2008 at 12:56 pm
As long as you're selecting just that one column to concat, there's a trick that I believe is specific to SQL Server:
declare @table table(identifier int identity(1,1), ModuleID tinyint)
insert into @table...
May 20, 2008 at 12:25 pm
"PS: I'm using this to help in creating unique SKUs for auto parts where the same partnumber fits many different vehicles. "
Couldn't figure out how get the quote to work......
September 6, 2006 at 12:51 pm
There's an Import Wizard in SQL 2K. Fire up Enterprise Manager, connect to your server, and right click on your database. Select All Tasks, Import Data. That wizard should let you...
August 30, 2006 at 11:36 am
I would add that foreign keys should never allow NULLs. Sort of defeats the purpose of an enforced relationship.
--SJT
April 7, 2006 at 12:16 pm
Viewing 15 posts - 46 through 60 (of 151 total)