by
455 17
0
5
99k
2
Top 1% !
Pearl of Wisdom
Tagged
Specified
OpenSource
Popularity: 23193rd place
Languagemysql

VTiger Extraction Customers' Data by City

Extract from Vtiger Customers' List with address and to whom they have been assigned
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/1593359/VTiger-Extraction-Customers--Data-by-Cit?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
SET @city = '[CITY NAME]'; #Replace [CITY NAME] with your preferable city name SET @db_name='[DATABASE NAME]'; #Replace [DATABASE NAME] with your database name SET @myquery = CONCAT(' SELECT ', @db_name, '.vtiger_account.accountid AS \'Company Code\', ', @db_name, '.vtiger_account.accountname AS \'Company\', ', @db_name, '.vtiger_account.phone AS \'Phone 1\', ', @db_name, '.vtiger_account.otherphone AS \'Phone 2\', ', @db_name, '.vtiger_account.email1 AS \'Email 1\', ', @db_name, '.vtiger_account.email2 AS \'Email 2\', ', @db_name, '.vtiger_account.website AS \'Website\', ', @db_name, '.vtiger_account.fax AS \'Fax\', ', @db_name, '.vtiger_accountbillads.bill_city AS \'City\', ', @db_name, '.vtiger_accountbillads.bill_code AS \'TK\', ', @db_name, '.vtiger_accountbillads.bill_country AS \'Country\', ', @db_name, '.vtiger_accountbillads.bill_state AS \'State\', ', @db_name, '.vtiger_accountbillads.bill_street AS \'Street\', ', @db_name, '.vtiger_accountbillads.bill_pobox AS \'TK\', ', @db_name, '.vtiger_users.last_name AS \'Αssignment το\' FROM ', @db_name, '.vtiger_account INNER JOIN ', @db_name, '.vtiger_accountbillads ON ', @db_name, '.vtiger_account.accountid = ', @db_name, '.vtiger_accountbillads.accountaddressid INNER JOIN ', @db_name, '.vtiger_crmentity ON ', @db_name, '.vtiger_account.accountid = ', @db_name, '.vtiger_crmentity.crmid LEFT JOIN ', @db_name, '.vtiger_users ON ', @db_name, '.vtiger_crmentity.smownerid = ', @db_name, '.vtiger_users.id WHERE ', @db_name, '.vtiger_accountbillads.bill_city=@city AND ', @db_name, '.vtiger_crmentity.setype=\'Accounts\' '); PREPARE stmt FROM @myquery; EXECUTE stmt; DEALLOCATE PREPARE stmt;
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus