Viewing 15 posts - 4,936 through 4,950 (of 8,731 total)
TomThomson (5/14/2015)
Luis Cazares (5/14/2015)
May 14, 2015 at 7:28 pm
I was wondering, why would you have a value before an event happened? Shouldn't you have zeros until the first real occurrence?
May 14, 2015 at 7:27 pm
You receive a late call during the night to inform you that the server is down and must be working correctly before everyone arrives in the morning. How many cups...
May 14, 2015 at 1:09 pm
Maybe this got overcomplicated and Dwain's solution is better. But I just thought it was good to give this a shot.
DECLARE @DaysBefore int = 3; --Parameter?
DECLARE @StartDate Date = dateadd(dd,...
May 14, 2015 at 12:53 pm
Now I get the point. It just didn't hit me because I thought that a filter would be the easy part. Of course is easier to get the logic if...
May 13, 2015 at 3:37 pm
It's possible, but you need to be sure that you're applying the correct precedence.
If EXCEPT or INTERSECT is used together with other operators in an expression, it is evaluated...
May 13, 2015 at 3:14 pm
Lynn Pettis (5/13/2015)
May or may not answer the question. How do you want to handle the null date values? What would the results look like if you only...
May 13, 2015 at 3:08 pm
Maybe a real life scenario can help. Someone posted a problem that happens when using SELECT *.
http://www.sqlservercentral.com/Forums/Topic1685042-392-1.aspx
I'm sure that it's faster to code using * instead of the column names....
May 13, 2015 at 2:54 pm
This seems to do the trick. Please be sure to understand what it is doing and ask any questions that you have.
Running totals became a lot easier on SQL Server...
May 13, 2015 at 2:37 pm
Oh yeah, I saw the error that came from using a table value constructor for testing purposes.
The queries will give different results, but that's a difference on requirement understanding. I'm...
May 13, 2015 at 2:16 pm
tooba111 (5/13/2015)
Can You Please guide...
May 13, 2015 at 11:43 am
As long as this is only for reporting purposes, because as previously stated, it makes no sense to store so many repeated values.
You just need to query your table joining...
May 13, 2015 at 11:01 am
This is very similar to what Lynn already posted, with a little improvement to make the JOIN clause SARGable. I agree that recursion is not needed, neither the UNION ALL...
May 13, 2015 at 9:25 am
You have a few syntax mistakes, but the logic seems correct.
SELECT ProductSkuTypeId = pst.[ProductSkuTypeID],
ProductSkuTypeName = pst.[Name],
ProductTaxCodeID...
May 12, 2015 at 1:32 pm
Steve Jones - SSC Editor (5/12/2015)
May 12, 2015 at 12:33 pm
Viewing 15 posts - 4,936 through 4,950 (of 8,731 total)