How does a code get a null DateAdded?
Question asked by Stan Paulauskas - 3/29/2022 at 8:28 AM
Answered
I'm working on exporting data out of Atrex (Version 19) for inclusion in a data lake and EDW. I'm pull data from the tables in batches based on the date. Here's an example query: 

SELECT * FROM code WHERE DateAdded BETWEEN DATE '2021-01-01' AND DATE '2021-12-31'
I've found that in the code table some of the records have a DateAdded field set to null. The query is

SELECT * FROM code WHERE DateAdded is null
What situation would cause that to happen and how can we correct this?

2 Replies

Reply to Thread
0
Terry Swiers Replied
Employee Post Marked As Answer
Any direct access outside of the standard Atrex interface can potentially allow for this.  While DateAdded defaults to the current date, the field is NOT set as NOT NULL.  So it can be set to null manually using the ODBC or .NET adapter.

Lastly, DateAdded was introduced to the table back in version 15.  So any code that was created in an earlier version could have a null DateAdded value.

0
Stan Paulauskas Replied
Our company hasn't used programmatic access via ODBC or .NET before this application. Our Atrex DB started in late 2001. The audit logs indicate that many of these products were added quite a while ago. I suspect these were created before the update to Atrex 19. Thanks!

Reply to Thread