Differences
This shows you the differences between two versions of the page.
— |
control_sql_-_change_prospect_to_client [2019/01/27 11:28] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== | ||
+ | |||
+ | |||
+ | |||
+ | ===== Explanation of SQL ===== | ||
+ | |||
+ | |||
+ | |||
+ | When customers import contacts from another program that have not placed an order in Control, they are considered a " | ||
+ | |||
+ | |||
+ | |||
+ | This SQL will set **ALL** of your prospects imported on a specific date to a client status. | ||
+ | |||
+ | |||
+ | |||
+ | To update those records so they have a " | ||
+ | |||
+ | |||
+ | |||
+ | ===== Risk of Data Corruption if Run Improperly ===== | ||
+ | |||
+ | **High**. This query modifies the Account table. | ||
+ | |||
+ | |||
+ | |||
+ | ===== SQL ===== | ||
+ | |||
+ | |||
+ | |||
+ | <code sql> | ||
+ | Declare @ImportDate date; | ||
+ | -- adjust this to the specific import date (m/d/yyyy) | ||
+ | Set @ImportDate = ' | ||
+ | UPDATE Account | ||
+ | SET ISClient=1, IsProspect=0 | ||
+ | WHERE id > 1000 -- eliminate system accounts | ||
+ | and DateCreated = @ImportDate | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== Version Information ===== | ||
+ | * Entered : 8/15/2009 | ||
+ | * Version : 2.5+ | ||
+ | |||
+ | |||
+ | |||