Differences
This shows you the differences between two versions of the page.
— |
control_sql_-_identify_credit_cards_processed_but_not_saved [2019/01/27 11:28] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== | ||
+ | |||
+ | |||
+ | |||
+ | ===== Explanation of SQL ===== | ||
+ | |||
+ | |||
+ | |||
+ | If Control is terminated (e.g., CTRL-ALT-DEL) while processing an online credit card, the results of the credit card being run may not be written to the database. | ||
+ | |||
+ | |||
+ | |||
+ | This query searches for Credit Card Processed activities that do not have a completion event, and then looks up the status of those from the C3S tables. | ||
+ | |||
+ | |||
+ | |||
+ | The date and time of the range to be queries must be adjusted before running. | ||
+ | |||
+ | |||
+ | |||
+ | ===== Risk of Data Corruption if Run Improperly ===== | ||
+ | |||
+ | **None**. This is a selection query and no data is modified in the running of it. | ||
+ | |||
+ | |||
+ | |||
+ | ===== SQL ===== | ||
+ | |||
+ | |||
+ | |||
+ | <code sql> | ||
+ | -- This query identifies payments that | ||
+ | -- were processed but a response was not | ||
+ | -- logged in Control. | ||
+ | select | ||
+ | Journal.StartDateTime as [Date and Time], | ||
+ | Journal.ModifiedByUser as [User], SummaryAmount as Amount, | ||
+ | Journal.Description, | ||
+ | CT.Amount as CCAmount, WasSuccessful, | ||
+ | Account.CompanyName, | ||
+ | Journal.ID | ||
+ | --, Journal.Notes | ||
+ | --, CT.* | ||
+ | from CCCSTransactions CT | ||
+ | join CCCSCustomer CC on CT.CustomerGUID = CC.CustomerGUID | ||
+ | join Journal on CC.CustomerID = Journal.AccountID | ||
+ | left join Account on Journal.AccountID = Account.ID | ||
+ | where | ||
+ | Journal.ClassTypeID = 20030 | ||
+ | and Journal.Notes not like ' | ||
+ | and Journal.Notes not like ' | ||
+ | and CT.ProcessedDateTime between ' | ||
+ | and Journal.StartDateTime between ' | ||
+ | and abs(DATEDIFF(minute, | ||
+ | order by Journal.ID desc | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== Version Information ===== | ||
+ | * Entered : 01/2011 | ||
+ | * Version : 3.4+ | ||
+ | |||
+ | |||
+ | |||