Differences
This shows you the differences between two versions of the page.
control_sql_-_look_for_gl_adjustment_entries_on_parts_not_inventoried [2019/01/27 11:29] |
control_sql_-_look_for_gl_adjustment_entries_on_parts_not_inventoried [2019/01/27 11:29] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== | ||
+ | |||
+ | |||
+ | |||
+ | ===== Explanation of SQL ===== | ||
+ | |||
+ | |||
+ | |||
+ | When you adjust the inventory level on a Part that is NOT accruing costs, no GL entries should be made. In some historic cases (in Control 4.3), these entries were made. This query identifies those entries. | ||
+ | |||
+ | |||
+ | |||
+ | ===== Risk of Data Corruption if Run Improperly ===== | ||
+ | |||
+ | **High**. Data is modified in this query. Do not run this except under the direction of a Cyrious Technical Support staff member. Doing otherwise may result in lost or contaminated data. All data modifications done through direct SQL **are permanent and non-reversable**. | ||
+ | |||
+ | |||
+ | |||
+ | ===== SQL ===== | ||
+ | |||
+ | |||
+ | |||
+ | <code sql> | ||
+ | select ID, | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | * | ||
+ | from GL | ||
+ | where PartID is not NULL | ||
+ | and PartID in (select ID from Part where AccrueCosts = 0) | ||
+ | and AccountID is NULL | ||
+ | and Description is not NULL | ||
+ | -- and EntryDateTime >= ' | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== Version Information ===== | ||
+ | * Entered : 12/2009 | ||
+ | * Version : Control 4.3 | ||
+ | |||
+ | |||
+ | |||