As I was double checking some of my queries I discovered an oddity. An update query I have updates 12831 records, but the identical select query shows 13022 records.
Aroo??
The query updates one field to "X" based on some criteria. There's nothing special about the field. It's set as varchar(1) and to allow nulls.
Queries are below:
I tried adding the full server.database.name and that didn't help. Changing the Month = stuff to just simply be month = 7, etc. didn't help.
What is going on here? Please help!
Aroo??
The query updates one field to "X" based on some criteria. There's nothing special about the field. It's set as varchar(1) and to allow nulls.
Queries are below:
Code:
UPDATE Reporting_CurrentDetails
SET Runoff = 'X'
FROM PSME.CapCostFore.Reporting_CurrentDetails
INNER JOIN PSME.CapCostFore.History_PriorDetails
ON Reporting_CurrentDetails.AcctSchd = History_PriorDetails.AcctSchd
AND Reporting_CurrentDetails.Idms_Region = History_PriorDetails.Idms_Region
WHERE (Reporting_CurrentDetails.Status_Code = '9')
AND (MONTH(Reporting_CurrentDetails.Status_Date)
= MONTH(DATEADD(month, - 1, CONVERT(date, SYSDATETIME()))))
AND (YEAR(Reporting_CurrentDetails.Status_Date)
= YEAR(DATEADD(month, - 1, CONVERT(date, SYSDATETIME()))))
AND (History_PriorDetails.Status_Code <> '9')
AND ((Reporting_CurrentDetails.Status_Code
+ Reporting_CurrentDetails.Term_Code) <> '9P')
SELECT *
FROM PSME.CapCostFore.Reporting_CurrentDetails
INNER JOIN PSME.CapCostFore.History_PriorDetails
ON Reporting_CurrentDetails.AcctSchd = History_PriorDetails.AcctSchd
AND Reporting_CurrentDetails.Idms_Region = History_PriorDetails.Idms_Region
WHERE (Reporting_CurrentDetails.Status_Code = '9')
AND (MONTH(Reporting_CurrentDetails.Status_Date)
= MONTH(DATEADD(month, - 1, CONVERT(date, SYSDATETIME()))))
AND (YEAR(Reporting_CurrentDetails.Status_Date)
= YEAR(DATEADD(month, - 1, CONVERT(date, SYSDATETIME()))))
AND (History_PriorDetails.Status_Code <> '9')
AND ((Reporting_CurrentDetails.Status_Code
+ Reporting_CurrentDetails.Term_Code) <> '9P')
I tried adding the full server.database.name and that didn't help. Changing the Month = stuff to just simply be month = 7, etc. didn't help.
What is going on here? Please help!