We’ve got a problem with a table where COUNT returns one less record than there are in the table.
COUNT returns 9089 records
Copy and pasting the table to Excel gives 9090 records.
SELECT * in Query Analyser also returns 9090 records.
We’ve not noticed this with other tables! The unusual thing about this table, however, is the data is imported into it using a T-Sql script, but whether this is part of the problem I don’t know.
I will make basica assumptions that this is on SQL, and that you are using COUNT, and not COUNTAPPROX.
We would need to know exactly how you are counting the records and importing them. If you are block importing the whole tbale, and then doing a count, then it seems odd, and definitely there is some information missing.
If you are importing records one at a time over a period, and then randomly doing a count, then there could be issues with GETLATEST VERSION or a commit issue. So we need to see a sample of the code that is causeing th e problem.
Also what version of SQL. This was a definite and known issue in version 2.60, but I am assuming you to be on a much newer version.
So what are the properties of the flowfield, I would assume that the coding error is in that. I am also going to assume that you have tried to log out and back in again to ensire that its not a latest version issue.
No, any suggestions on how I do that? No. of rows in Excel are as above.
This is our own table, the primary key is CorrelationID, LogDateTime where CorrelationID is type CODE 36, and LogDateTime is type DATETIME. There are no rows with a missing primary key field.
Go into File/Database/Information from within Navision, click on the Tables button, find your table (will be more than one if you have multiple companies and it is not a non company specific table). See how many records are displayed as the count there. Click on the Test button for that table ONLY. See if there are any errors.
The issue may have been a get latest version issue. If tghe data is being added through SQL, its possible that it has not registed fully in Navision. If you see the error again, then try logging out, closing the server, restarting the SQL server, and then try again. I know this is tough to do in a production environment, but if you can do it, at least you will know if that’s the issue or not.