|
You can create your own queries if you know QBE
and SQL or have us create them for you. Following are instructions for
writing your own queries. You can also simply browse through the
instructions to get an idea of what queries can do. Several sample
queries are included in the download (they are described below).
If you would like us to create a
Mailware Query for you please contact
us.
The download above contains several sample queries you
can examine, edit and use. Anyone can install and use the samples,
however it is strongly recommended you install them to your Sample
Data Directory and test them there. When prompted for the Data
Directory (not the install directory) select your Sample Data Directory folder
(usually c:\mailw15\sampdata - see Locating
your Data Directory in our Tips
page).
After installing the query tool, open Mailware. Click
the Tools text menu item. The bottom portion of the menu will contain
a list of available queries. You can run a query by simply
selecting it, however some queries require you create a text file
first (e.g., ImportTrackingNumbers.mwq).

We recommend you try the Create Rental
Table query first. This will create a Rental.db table in your data
directory that contains your
customer information. It is a safe one to run because it does not
affect any of your data. However, it may take a while if you have a
very large customer list.
The queries that will be installed are:
-
CleanItems.mwq - Deletes orders with blank order numbers.
-
ClearTracking.mwq - Empties the Tracking.db table. This deletes
ALL tracking information for ALL ORDERS.
-
Create Rental Table.mwq - Creates a Rental.db table of names from your customer database to rent to other companies.
Note: Rental.db includes credit card information.
-
FixImportedPhones.mwq - Formats phone numbers to include dashes (123-123-1234)
-
ImportTrackingNumbers.mwq - Imports tracking numbers from a file created from your shipping software. The file must be in comma delimited format and must contain the Mailware order number and the tracking number (e.g., "10", "123" imports tracking number 123 into order number 10).
Name the file "TrackingNumbers.txt" and place it in your data directory.
-
Markship.mwq - For versions of Mailware
prior to 1.7 that are upgrading to 1.7 or higher - Marks all items in all orders as Shipped.
-
Paid.mwq - Calculates the total order amount and enters it into the paid amount field on the Order screen Payment tab.
This is useful for imports that do not include the paid
information (e.g., the Yahoo-MOM import from Yahoo Stores).
-
SalesTaxReporting.mwq - Creates the table SALESTAXREPORTING.DBF which lists all orders, their taxable amounts and sales tax collected.
Advanced Users
To create your own queries you need to know QBE (Query
By Example) and SQL query languages. If not, you can order queries
through our custom programming
service.
Following are the commands you can use in a Mailware
Query and a sample query. Items in [ ] are typed without the brackets.
You can also open the installed queries with Notepad to review them.
Commands
------------------------------------------------
DEBUG ON
SHOWMESSAGE: [Message]
SHOWOKCANCEL: [Prompt]
OPENTABLE: [TABLENAME]
COPYFIELD: [SOURCEFIELDNAME]->[DESTFIELDNAME] (use Closetable,
opentable, copyfield, closetable)
CLOSETABLE:
EXPORTSQLCSV: [FILENAME] (query results to csv file)
EXPORTQBECSV: [FILENAME]
EXPORTTABLECSV: (Opentable, exporttablecsv, closetable)
EMPTYTABLE: [TABLENAME]
IMPORTCSV: [FILENAME->TABLENAME]
QUERY
ANSWER: MWQUERY:[TABLENAME]
SQLQUERY
OPTIONS: REQUESTLIVE (Live query with one table so editable)
Note: If using Borland’s Database Desktop use working directory to make references relative
Sample Query
-------------------------------------------------
Query
ANSWER: :PRIV:ANSWER.DBF
TYPE: DBASE
\Maildata\data\Tracking.DBF | ORDERNO | TRACKINGNO | CHARGES |
| not blank, _orderno | _trackingno | _charges |
\Maildata\data\Tracking.DBF | WEIGHT | SHIPTIME | CARRIER | METHOD |
| _weight | _time | _carrier | _method |
\Maildata\data\Tracking.DBF | EXTRA1 | EXTRA2 | EXTRA3 |
| _extra1 | _extra2 | _extra3 |
\Maildata\data\Tracking.DB | OrderNo | TrackingNo | Charges | Weight |
Insert | _orderno | _trackingno | _charges | _weight |
\Maildata\data\Tracking.DB | ShipTime | Carrier | Method | Extra1 |
| _time | UPS | _method | _extra1 |
\Maildata\data\Tracking.DB | Extra2 | Extra3 |
| _extra2 | _extra3 |
\Maildata\data\Orders.DB | OrderNo |
| _orderno |
EndQuery
|