SELECT DISTINCT 'Phone' as Ind, cust.phone_number as 'Phone' ,cust.Name, cust.Address FROM $trans_db.Sales_Invoice_Main tab JOIN $master_db.address_book  cust ON cust.phone_number =tab.POC_Phone where  tab.Voucher_Date>=str_to_date('$fromDateTime','%Y-%m-%d') and  tab.Voucher_Date<=str_to_date('$toDateTime','%Y-%m-%d') and tab.POC_Phone <> ''