Viewing 15 posts - 166 through 180 (of 668 total)
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...
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...
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.
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...
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
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":...
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 ...
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
TempCount AS
(
SELECT
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...
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...
December 27, 2018 at 9:03 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...
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
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
December 26, 2018 at 8:11 am
It was just an example. I used this to get the groupings.
RowNum % 3
You can modify to this: RowNum % 500, I just wasn't going...
December 26, 2018 at 7:22 am
Viewing 15 posts - 166 through 180 (of 668 total)