Advertisement
filotti

Untitled

Dec 5th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. SAAS_URL=https://saas.quadminds.com/io/e-automate/import_service_calls.php
  2. API_KEY=P4DzcKu0p5RIfMHe9jcybFPQBuEUtLKS1xW4997c
  3. SQL_USER=qm_read_only
  4. SQL_PASSWORD=quadminds
  5. SQL_SERVER=ARIEL-PC\SQLEXPRESS
  6. SQL_DATABASE=Cobarlop
  7. QUERY="SELECT CallNumber = c.CallNumber, Description = c.Description, Date = c.Date, ReqDate = c.ReqDate, EstStartDate = c.EstStartDate, CustomerName = cust.CustomerName, Caller = c.Caller, EquipmentNumber = e.EquipmentNumber, Item = i.Item, TerritoryDesc = terr.Description, Technician = ltrim(rtrim(sa.PrefFullName)), BillCode = bc.BillCode, CallType = ct.CallType, Priority = pr.Priority, Status = cst.Description, Location = e.Location, AddressStreet = c.AddressStreet, AddressCity = c.AddressCity, AddressState = c.AddressState, AddressZip = c.AddressZip, EquipRemarks = CASE WHEN LEN(e.Remarks) >255 THEN LEFT(e.Remarks,252) + '...' ELSE e.Remarks END, Contact = e.Contact, ContactPhone = e.ContactPhone, FlagColor = '', TextColor = '', MarkerName = '' FROM SCCalls c INNER JOIN ARCustomers cust ON cust.CustomerID = c.CustomerID INNER JOIN ARCustomers billto ON billto.CustomerID = c.BillToID LEFT JOIN SCEquipments e ON e.EquipmentID = c.EquipmentID LEFT JOIN ARCustomers loc ON loc.CustomerID = e.LocationID LEFT JOIN ICItems i ON i.ItemID = e.ItemID LEFT JOIN SCTerritories terr ON terr.TerritoryID = e.TerritoryID LEFT JOIN SHAgents sa ON sa.AgentID = c.TechnicianID LEFT JOIN SCBillCodes bc ON bc.BillCodeID = c.BillCodeID LEFT JOIN SCCallTypes ct ON ct.CallTypeID = c.CallTypeID LEFT JOIN SCPriorities pr ON pr.PriorityID = c.PriorityID LEFT JOIN SCCallStatusTypes cst ON cst.Type = c.Status where c.status in ('D','H','P','S') ORDER BY c.CallNumber"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement