Viewing 15 posts - 40,501 through 40,515 (of 59,072 total)
freeman.e.l (12/24/2009)
declare @start_date datetime
declare @end_date datetime
declare @diff int
set @start_date = '3/9/2009'
set @end_date = '3/13/2009'
set @diff = datediff(dd,@start_date,@end_date)
create table #Results ([Month Start] datetime, [Month End] datetime, [Total Days] int, [Amount] money)
insert...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 24, 2009 at 1:54 am
I haven't check the rest of your good post, but don't ever use @@IDENTITY... if a trigger is ever place on the table in question, @@IDENTITY will return incorrect answers....
--Jeff Moden
Change is inevitable... Change for the better is not.
December 24, 2009 at 1:46 am
Thanks for the feedback, Solomon. Glad to see folks using it for smart stuff.
As a side bar, Matt Miller and I had some friendly races a couple/three years ago...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 24, 2009 at 1:00 am
Biz (12/23/2009)
Hi Jeff,Thats working... Was thinking to sort it dynamically and then do this.
But this is really easy..
Thanks
Merry Xmas..
Thanks for the feedback. "Easy" is good. 😉 Shifting...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2009 at 5:57 pm
Next question, please... What application would have the need for such a thing where it could not be done using T-SQL? Not trying to be a smart guy...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2009 at 5:54 pm
Paul Morris-1011726 (12/23/2009)
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2009 at 3:54 pm
roundel1900 (12/23/2009)
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2009 at 3:48 pm
...but I wanted to create TVFs so that I could more easily interact with the output by doing WHERE conditions, GROUP BYs, ORDER BYs, etc. which are not possible with...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2009 at 10:46 am
Biz (12/22/2009)
I am still modifying this, though it is giving the serial number, I need to get the order of the serial number by the [course start date].
So trying...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2009 at 8:41 am
Ah... I see the problem. The alter table does not happen at compile or run time. It happens when it is actually executed. The only way that...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 22, 2009 at 8:25 pm
TheSQLGuru (12/22/2009)
d:\sqlexp\112233
d:\sqlexp\112233\20091211
d:\sqlexp\112233\20091212
d:\sqlexp\112233\20091213
d:\sqlexp\112233\20091214
d:\sqlexp\112233\20091215
d:\sqlexp\112233\20091216
d:\sqlexp\112233\20091217
d:\sqlexp\112244
d:\sqlexp\112244\20091211
d:\sqlexp\112244\20091212
d:\sqlexp\112244\20091213
d:\sqlexp\112244\20091214
d:\sqlexp\112244\20091215
d:\sqlexp\112244\20091216
d:\sqlexp\112244\20091217
I seem to get the following output from...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 22, 2009 at 8:20 pm
Nabha (12/22/2009)
Jeff Moden (12/22/2009)
SELECT DATEADD(dd,DATEDIFF(dd,6,GETDATE()+1)/7*7,-9)+t.Number
FROM Master.dbo.spt_Values t
WHERE t.Type...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 22, 2009 at 8:17 pm
Heh... I probably wouldn't use SSIS for such a thing. I damned sure wouldn't use a script for this. T-SQL would do the job just fine.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 22, 2009 at 8:14 pm
mmdmurphy (12/22/2009)
I found the critical lines in the visual basic script that gets the data, and...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 22, 2009 at 8:06 pm
The Dixie Flatline (12/22/2009)
Bring forth the Holy Pork Chop of Antioch! 😛
Heh... paraphrased from one of my favorite "B" movies...
"Glory be to the [Code], and to the Holy [Forum]....
--Jeff Moden
Change is inevitable... Change for the better is not.
December 22, 2009 at 7:59 pm
Viewing 15 posts - 40,501 through 40,515 (of 59,072 total)