Viewing 15 posts - 46 through 60 (of 71 total)
Thanks to all, that's great. Yes, I'm storing these dates in a table for future use.
Last one, a variation on the same, this time to find future Fridays.
select @CalendarDate =...
November 11, 2011 at 9:59 am
Thanks.
I've just checked and my two Ref columns could actually be up to 50 wide which I think is the reason I had the clustered index only on the...
November 1, 2011 at 8:34 am
"Never, never use MONEY data types; their math is wrong!"
Bit off topic but I wasn't aware of this and have used MONEY columns occasionally. Could you elaborate and should I...
October 28, 2011 at 1:02 pm
select @NewT = dateadd(day, -1 * datediff(day, '01/01/1900', @OrigDT), @OrigDT)
Seems to do it?
October 28, 2011 at 4:54 am
Just an update, decided to abandon the cursor method for calculating running totals and went straight to the Quirky Update - followed Jeff's article to the letter and it works...
October 27, 2011 at 8:57 am
Imagine that you have 20 rows in the outer query and you need an aggregation of 10-50 related records in another table (TableB) for each of the 20. If...
October 21, 2011 at 2:09 am
I think I've covered that one by rebuilding the running totals from the earliest date in the table that will be affected by the new batch of rows. Of course...
September 15, 2011 at 2:19 pm
I'm actually opposed to storing running totals in permanent tables for various reasons we can get into later.
Given the implications for me, you'd better tell me sooner rather than later....
September 15, 2011 at 11:58 am
Thanks to all for the advice, I'll go away and try to re-write my running total...code will follow if I hit problems!
There seems to be two issues:
1. How to calculate...
September 14, 2011 at 1:48 am
Thanks. I presume it can be done without a calendar table, but on looking at the link provided I can see the advantages of it as I have to do...
September 5, 2011 at 2:36 am
That seems to do it. I'd experimented with case and isnull but never got as far as using them using together. Thanks for this!
August 31, 2011 at 1:27 pm
One more question. I'm currently on 2005 and hope to move to 2008 R2 shortly. I haven't looked into yet but I was thinking about changing my 'upserts' to using...
July 24, 2011 at 5:19 am
Wow, thanks Paul - great article! I'd got as far as seeing the problems in writing out the combinations, coalesce and isnull, but would never have thought of using intersect...
July 24, 2011 at 4:29 am
Sorry, haven't got access to my sql code at the moment but the example I've given matches it. The only nullable column is A and it's a one-to-one relationship between...
July 22, 2011 at 11:29 am
count(@A) will work in the cut-down example I posted using only variables, a select without any table referenced. count(ColA) won't of course work without a sub-query.
I came across the...
July 22, 2011 at 9:21 am
Viewing 15 posts - 46 through 60 (of 71 total)