Viewing 15 posts - 4,066 through 4,080 (of 7,597 total)
It might be worth trying code below, as it seems to limit the number of "j" lookups required. A nested-loop join didn't prevent the extra lookups -- for whatever...
October 17, 2016 at 1:07 pm
whenriksen (10/17/2016)
ScottPletcher (10/17/2016)
October 17, 2016 at 9:40 am
whenriksen (10/17/2016)
ScottPletcher (10/14/2016)
SELECT COUNT(*),
...
October 17, 2016 at 8:31 am
whenriksen (10/14/2016)
First day of the business week is Monday.What do you recommend?
I posted code that did that type of calc already. What specifically are you trying to list?
If you...
October 14, 2016 at 4:30 pm
whenriksen (10/14/2016)
SELECT COUNT(*),
CAST(DATEADD(WEEK, DATEDIFF(WEEK, '20061231', DATEADD(DAY, 7
- CASE DATEPART(WEEKDAY, o.modify_date) WHEN...
October 14, 2016 at 4:04 pm
Here's a simple, brute-force -- but still no looping -- method, if you prefer that.
SELECT
string AS original_string,
CASE WHEN are_enough_delims_present = 0 THEN...
October 14, 2016 at 12:02 pm
Typically a single query works best in that case, since the ytd query will by definition include the other data. Not sure what your definition of "week" is, but...
October 14, 2016 at 11:43 am
whenriksen (10/14/2016)
ScottPletcher (10/14/2016)
October 14, 2016 at 11:26 am
spaghettidba (10/14/2016)
Generally speaking, triggers are a very bad place to implement business logic, because they make the code difficult to debug/follow. They are some sort of "hidden" code that is...
October 14, 2016 at 10:54 am
The Dixie Flatline (10/13/2016)
Also, although I haven't done time trials, I have no trouble believing that sometimes a simple index seek can take less time than a complex calculation against...
October 14, 2016 at 9:42 am
whenriksen (10/13/2016)
ScottPletcher (10/13/2016)
I don't see how that would be the case. Couldn't you just use simple math to calc the pay periods, then join to the pre-calc'd dates? ...
October 14, 2016 at 9:33 am
You'll want to match directly on id, then you can use CHECKSUM across the other columns. Remember to always think set-based when possible, to get max benefits from SQL's processing.
SET...
October 13, 2016 at 12:57 pm
whenriksen (10/13/2016)
One request I received at my work was to see...
October 13, 2016 at 10:41 am
Do you want each individual date difference or do you just want an average days' difference between orders? The latter is much less work to calc :-).
October 13, 2016 at 10:38 am
Good article, but there's a much easier way to calc the nth given day of a given month. Also, btw, Thanksgiving is the fourth Thursday of the month not...
October 13, 2016 at 8:50 am
Viewing 15 posts - 4,066 through 4,080 (of 7,597 total)