Why we built this tool<\/strong><\/p>\nThose of you who work a lot with Access and SQL Server, in particular when upgrading an existing Access application, will no doubt appreciate the convenience of being able to convert queries with ease Granted, a lot of simple Select queries don’t need translation, but for the rest, in particular action queries, it will be a boon in productivity.<\/p>\n
How it works<\/strong><\/p>\nPaste your Access query on the left panel, click on the “Convert” button and see your TSQL equivalent on the right, it’s that easy:<\/p>\n
Plugin the following Access query:<\/p>\n
SELECT tblEvents.*, tblEstimates.OrderNum, tblCompanies.Company, tblEmployees.Employee, \r\ntblEstimates.JobName, tblEventTypes.EventType, tblEventStatus.EventStatus, \r\ntblCompanies.Company\r\nFROM ((((tblEvents LEFT JOIN tblCompanies ON tblEvents.CompanyID = tblCompanies.CompanyID) \r\nLEFT JOIN tblEmployees ON tblEvents.EmployeeID = tblEmployees.EmployeeID) \r\nLEFT JOIN tblEventStatus ON tblEvents.EventStatusID = tblEventStatus.EventStatusID) \r\nLEFT JOIN tblEventTypes ON tblEvents.EventTypeID = tblEventTypes.EventTypeID) \r\nLEFT JOIN tblEstimates ON tblEvents.EstimateID = tblEstimates.EstimateID\r\nWHERE (((tblCompanies.Company) Like \"*inc*\"));<\/pre>\nAnd get the TSQL equivalent:<\/p>\n
SELECT tblEvents.*\r\n,tblEstimates.OrderNum\r\n,tblCompanies.Company\r\n,tblEmployees.Employee\r\n,tblEstimates.JobName\r\n,tblEventTypes.EventType\r\n,tblEventStatus.EventStatus\r\n,tblCompanies.Company \r\nFROM ((((tblEvents\r\nLEFT JOIN tblCompanies ON tblEvents.CompanyID = tblCompanies.CompanyID)\r\nLEFT JOIN tblEmployees ON tblEvents.EmployeeID = tblEmployees.EmployeeID)\r\nLEFT JOIN tblEventStatus ON tblEvents.EventStatusID = tblEventStatus.EventStatusID)\r\nLEFT JOIN tblEventTypes ON tblEvents.EventTypeID = tblEventTypes.EventTypeID)\r\nLEFT JOIN tblEstimates ON tblEvents.EstimateID = tblEstimates.EstimateID \r\nWHERE (((tblCompanies.Company) LIKE '%inc%'))<\/pre>\nNotice the following:<\/p>\n
\n- The system will format your SQL for easy reading.<\/li>\n
- It will also convert Access syntax to TSQL syntax, for example the Where clause WHERE (((tblCompanies.Company) Like “*inc*”));<\/em> turns into: WHERE (((tblCompanies.Company) LIKE ‘%inc%’)).\u00a0<\/em>The tool converted “*” into “%” and the double quotes into single quotes.<\/li>\n<\/ul>\n
BUT WAIT, THERE’S MORE!<\/strong><\/p>\nYou will notice there’s a VBA tab on each side, clicking on each will provide you with a text string you can easily paste into your code:<\/p>\n
<\/pre>\nNow you don’t have to spend hours on each project converting your queries to code, just paste into the tool, click on the VBA tab and copy to your code, a real time saver! Notice you can remove vbCrLf by unchecking it on the upper right:<\/p>\n