![]() |
![]() |
Technical Support
|
![]() |
This category contains queries that involve QuickBooks program settings or information about the company as a whole.
The queries listed below are generally arranged from simple to complex. Normally, queries that get their data from only 1 table and do not aggregate any fields are listed first. To get full benefit of these queries and create your own queries - you should understand joins (where multiple tables are combined into a single table) and aggregation (where numeric columns from multiple rows are combined into 1 column). These concepts are not as difficult as they first appear and a web search for 'SQL' and 'join' or 'aggregation' will bring up hundreds of tutorials.
Where a line of dashes (like: --------------------) appears in a query, a useful variation of the query is shown. It could be very simple, such as changing the sort order of the output - or more complex, such as a complete alternate query. Where a single line in the query has the character: # as it's leftmost character - that line is a comment and is not processed by our query runner.
SELECT *
FROM xSettings
SELECT *
FROM aClass
ORDER BY sFullName
SELECT sCompanyName, sCountry, bSample,
sFiscalMonth, sTaxMonth, sCompType, sTaxForm
FROM xCompany
SELECT sLastName, sFirstName, sMidName,
'Customer' AS Type,
sFullName AS CompanyName
FROM cCustJob
WHERE LEN(sLastName) > 0
UNION
SELECT sLastName, sFirstName, sMidName,
'Vendor', sName
FROM vVendor
WHERE LEN(sLastName) > 0
UNION
SELECT sLastName, sFirstName, sMidName,
'Employee', '' FROM pEmployee
WHERE LEN(sLastName) > 0
UNION
SELECT sLastName, sFirstName, sMidName,
'OtherName', '' FROM xOtherName
WHERE LEN(sLastName) > 0
ORDER BY sLastName, sFirstName, sMidName