Viewing 15 posts - 166 through 180 (of 670 total)
I was able to get this to return the correct data. Format File and data file are attached
Here's the sql
...
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
January 4, 2019 at 9:50 am
I don't know your data, but you are taking every record in the PCT table and applying it to every record in the ProductionCosts tables. Does the PCT table represent...
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
January 4, 2019 at 9:32 am
There are a lot of articles on why float is not an accurate datatype to be using even on this site as well as Books Online. With that said, how...
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
January 4, 2019 at 7:55 am
Looks like it is working properly. It is summing based on the Week number in your table. You'll need to define those 3 days as in the same week.
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
January 4, 2019 at 6:43 am
This doesn't make much sense. Are the ranges hardcoded or variable? how are they determined? You can simply do a sum and a case when to handle it, but it's...
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
January 2, 2019 at 1:47 pm
your DDL is incorrect. The data doesn't match the sample query you sent. Please provide relevant DDL and sample data and test it before posting
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
January 2, 2019 at 12:44 pm
try this, it returns the AdvertisementID, but you can tweak as needed
declare @j-2 nvarchar(max) = '{
"property": {
"address": {
"councilArea": "KING",
"councilAreaId": 12345,
"isDerivedUnit":...
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
January 2, 2019 at 12:34 pm
This doesn't make any sense. The data doesn't help with what you want. Can you explain? This is what the sample data produced
ID Name Budget_Day DateCreated ...
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
December 27, 2018 at 12:03 pm
These 2 things look wrong to me
This is getting count of all records from CTE regardless of ID For better, quicker answers, click on the following... For better answers on performance questions, click on the following...
TempCount AS
(
SELECT
http://www.sqlservercentral.com/articles/Best+Practices/61537/
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
December 27, 2018 at 9:17 am
Can you step through it in the debugger? Does the statement you created run successfully? Lastly, try putting the Exec (@SQL) in a try catch block to see if there...
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
December 27, 2018 at 9:07 am
what datatype is PolicyExpirationDate? Converting the null to datetime shouldn't be an issue. See below. Can you reproduce it in some sample data?
drop table if...
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
December 27, 2018 at 9:03 am
have you tried looking in msdb?
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
December 26, 2018 at 11:57 am
If the fields aren't there (i.e Field4), then the entire row won't return. You can use a Left join instead of a Join to return missing rows and then handle the...
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
December 26, 2018 at 8:38 am
Since it's being called from multiple places, the only way to get it is to pass it in as a parameter
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
December 26, 2018 at 8:31 am
I'm not sure why you need ServerName, since you could have potential issues with linked servers. To get the info for each db, you can use sp_MSforeachdb. Something like
For better, quicker answers, click on the following... For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
December 26, 2018 at 8:11 am
Viewing 15 posts - 166 through 180 (of 670 total)