Viewing 15 posts - 6,946 through 6,960 (of 59,070 total)
DATEDIFF(mm,0,[Date]) calculates the number of month boundaries crossed (in effect, returns a count of months) since day "0", which is the 1st of January, 1900. That means that each date...
June 4, 2020 at 5:25 pm
Fill factor only comes into play when the index is NEW or REBUILT. Basically, it is just telling SQL that the data is either changing frequently or the inserts...
June 4, 2020 at 4:36 pm
Heh... Most people have a rule of "Normalize 'til it hurts then denomalize 'til it works". I disagree with that. My rule of thumb is "Normalize 'til it hurts... then...
June 4, 2020 at 4:03 pm
Thanks for the feedback and you're welcome. The key now is, since you're the one that has to support the code, do you understand how it works? Especially the DATEDIFF/DATEADD...
June 4, 2020 at 3:59 pm
I think either are acceptable, but I think one will have better performance. I am pretty sure "NOT NULL" is not sargable so you may have a performance hit...
June 4, 2020 at 3:56 pm
Generally, I try to avoid all "IsPresent", "IsCurrent", "IsActive", and, for sure "IsInactive" and "IsNotCurrent" columns, etc, etc. The data tells it all.
June 4, 2020 at 3:32 pm
Try this...
SELECT Name
,country
,avg_amount = AVG(amount)
...
June 4, 2020 at 3:30 pm
Since your result set that shows what you want to display doesn't contain results that match with your sample data in the 3rd column, what are you looking for in...
June 4, 2020 at 3:16 pm
Nothing like stating the obvious, Joe.
June 3, 2020 at 4:29 pm
My solution was
select AllergyName,
MAX(CASE WHEN ScaleValue = 'Low' THEN ScaleStart else 0 end) AS [LowStart],
MAX(CASE WHEN ScaleValue = 'Low' THEN ScaleEnd else 0 end) AS [LowEnd],
MAX(CASE...
June 3, 2020 at 2:47 pm
Lordy... there's a "bot" running with the handle of "Stanley" and it's posting spam every 5 minutes. Between that and another bot that was active only for a while, I'll...
June 3, 2020 at 4:32 am
I played around with the query a little and added percentage columns.
The math works, but it seems to default to six decimal places. 100% - 100.000000. Is there a...
June 3, 2020 at 1:53 am
Mine is similar but I took advantage of IIF. It still renders out as CASE expressions behind the scenes so no performance gain or anything like that. I also think...
June 3, 2020 at 12:46 am
Your suggestion worked. Thanks. I am just getting the hang of this but will post the working formula even though there is probably a better way to do this.
CONVERT(DECIMAL...
June 2, 2020 at 10:07 pm
Thank you both so much! I was trying to be cute and figure out how to use the PIVOT operation, but going back to the basics and using the...
June 2, 2020 at 10:04 pm
Viewing 15 posts - 6,946 through 6,960 (of 59,070 total)