home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / bus_pers / bankbook.arc / banknq.doc < prev    next >
Text File  |  1988-02-20  |  13KB  |  261 lines

  1.                               Query Instructions
  2.        
  3.        
  4.        The Query program will  allow  you  to  produce a report based on
  5.        your selection,  sorting  and  formatting  specifications.   Upon
  6.        entry, you will be presented  with  a  data dictionary and string
  7.        gadgets  for  entering  your  record   selection  criteria,  sort
  8.        sequence and output report format.
  9.        
  10.        The data dictionary presents  you  with a list of data names that
  11.        can be used to display or print values contained in the database.
  12.        
  13.        The Select string gadget will allow you to specify some selection
  14.        criteria to be used to determine which  database  entries will be
  15.        included in you output display or report.  For example,
  16.        
  17.             SELECT:
  18.             (Payee = "Allstate" or "State Farm") and Amount > 100.00"
  19.        
  20.        specifies that the database is to be searched for Payees with the
  21.        name of "Allstate" or  "State  Farm"  with  an  Amount > $100.00.
  22.        Remember that in order  to  enter  data  into a string gadget you
  23.        must first position the pointer within the gadget and depress the
  24.        left button on  the  mouse.   Note  that  the  Select  parameters
  25.        contain  parentheses  to  prevent  ambiguities.   If  there  is a
  26.        possibility that the  key  word  or  phrase  you  are looking for
  27.        contains occurrences with both upper  and lower case letters, you
  28.        must check for both,  e.g.,  "Allstate"  or  "allstate".  Another
  29.        method is to use the wild character, e.g., "?llstate".
  30.        
  31.        The Sort string gadget will allow  you to specify the sequence in
  32.        which the selected records are  to  be displayed or printed.  For
  33.        example,
  34.        
  35.             SORT:
  36.             Date
  37.        
  38.        specifies that the selected database  entries are to be sorted in
  39.        Date sequence.  Only one sort  field  may  be specified.  To sort
  40.        the field as a date, enter  cdate(Date).   This  option will make
  41.        the years sort in the correct order.
  42.        
  43.        The Report string gadget will allow  you to specify the format of
  44.        the output display or report.  For example,
  45.        
  46.             REPORT:
  47.             Date, col 13, Type, col 18, Payee, col 44, Amount
  48.        
  49.        specifies that the Date, Type, Payee  and Amount for the selected
  50.        records are to be displayed.   Further,  it is specified that the
  51.        Date is to be displayed beginning in column 1, the Type in column
  52.        13, the Payee in column 18 and  Amount  in column 44.  The Report
  53.        specification  parameters  may  be  very  simple  or very complex
  54.        depending upon the skill of the  user.   Upon  entering the Query
  55.        program, you will find  that  the  Report  string  gadget already
  56.        contains some parameters.  These parameters have been designed to
  57.        simply list and total  the  selected  transactions.   You may use
  58.        these parameters or enter your customized  report specifications.
  59.        To erase the content on the  Report  string  gadget, first select
  60.        the gadget and then depress  Right  AMIGA  - X.  To undo (cancel)
  61.        the last editing change to the  string,  depress Right AMIGA - Q.
  62.        The Report specification  parameters  can be classified as either
  63.        describing "when to do it" or "what to do".
  64.        
  65.        When To Do It:
  66.                 
  67.                 page_top - specifies that subsequent functions are to be
  68.                 executed at the top each printed page or screen.
  69.                 
  70.                 page_bottom - specifies that subsequent functions are to
  71.                 the executed  at  the  bottom  of  each  printed page or
  72.                 screen.
  73.                 
  74.                 report_top - specifies that subsequent  functions are to
  75.                 be executed only at the beginning of the output report.
  76.                 
  77.                 report_bottom - specifies that  subsequent functions are
  78.                 to executed only at the end of the report.
  79.                 
  80.                 top(<data-name>) -  specifies  that subsequent functions
  81.                 are to be executed after there  has been a change in the
  82.                 content  of   <data-name>.    For  example,  top(Payee).
  83.                 Normally, the specified  data-name  will  be the same as
  84.                 the sort sequence.
  85.                 
  86.                 bottom(<data-name>)   -   specifies    that   subsequent
  87.                 functions are to be executed before there is a change in
  88.                 the content of data-name.  For example, bottom(EC).
  89.                 
  90.                 detail - specifies that the subsequent  functions are to
  91.                 be executed for each selected database entry.
  92.                 
  93.        What To Do:
  94.        
  95.                 print - specifies that all output is to be routed to the
  96.                 printer.  Default values  for  tm, bm and bod are set to
  97.                 4, 8, and 54 respectively.
  98.                 
  99.                 display - specifies that  all  output is to be routed to
  100.                 the screen.  "Display" is  the  output default.  Default
  101.                 values for tm,  bm  and  bod  are  set  to  0, 0, and 22
  102.                 respectively.
  103.                 
  104.                 tm nn - sets the top  margin  for  the output display or
  105.                 report to the value specified by nn.
  106.                 
  107.                 bm nn - sets the bottom margin for the output display or
  108.                 report to the value specified by nn.
  109.                 
  110.                 bod nn - sets the body of  the  output display or report
  111.                 to the value specified by nn.  The sum of tm, bm and bod
  112.                 must equal the desired page length.
  113.                 
  114.                 <data-name> -  causes  the  specified  data  name  to be
  115.                 printed  or  displayed.   For   example,  "Payee"  is  a
  116.                 data-name.
  117.                 
  118.                 "literal" - causes the  specified  literal to be printed
  119.                 or  displayed.   For  example,  "The  result  is:"  is a
  120.                 literal.
  121.                 
  122.                 trim(<data-name>) - caused the specified data name to be
  123.                 printed or displayed after all trailing spaces have been
  124.                 eliminated.  For example, "trim(Payee)".
  125.                 
  126.                 total(<data-name>) - specifies  that the summed value of
  127.                 <data-name> is to be  printed  or displayed.  An numeric
  128.                 data item  from the dictionary or a numeric literal must
  129.                 be   substituted   for   <data-name>.     For   example,
  130.                 "total(Amount)".   "total(1)"  can  be used to provide a
  131.                 count of the transactions.
  132.                 
  133.                 cum(<data-name>)  -  same  as  "total"  except  that the
  134.                 accumulator is not  reset  after  displaying  the total.
  135.                 This function is used to produce a running balance.
  136.                 
  137.                 spacer nn - causes  nn  spaces  to  be  inserted between
  138.                 output data items.  The default is 1.
  139.                 
  140.                 col nn - causes  the  next  specified  data  item  to be
  141.                 displayed or printed in the column specified by nn.
  142.                 
  143.                 skip n - causes n lines to be  skipped before displaying
  144.                 or printing the next data item.  If n is not provided, 1
  145.                 is assumed.
  146.                 
  147.                 pause - causes a pause in the output process until a key
  148.                 (any key) is depressed.
  149.                 
  150.                 eject - if "print"  has  been  specified,  this  command
  151.                 causes the paper to be  ejected  to  the top of the next
  152.                 page; otherwise, the screen will be cleared.
  153.                 
  154.                 
  155.                 EDITING MASKS
  156.                 
  157.                 Numeric Editing Masks may  be  used  to cause predefined
  158.                 characters to be imbedded  within  displayed  or printed
  159.                 numeric items.  Numeric items are identified in the data
  160.                 dictionary with  the  character  "n"  following the data
  161.                 name.  The masks must be constructed  as an alphanumeric
  162.                 literal whose  first  character  is  "%".  If the second
  163.                 character of the mask  literal  is  other than a numeric
  164.                 character, that  character  will  be  placed in the next
  165.                 left most position before  the  resulting edited numeric
  166.                 value.
  167.                 
  168.                 Examples:
  169.                 
  170.                      Input Values       Mask         Output
  171.                 
  172.                          01000        "%9,999"        1,000
  173.                 
  174.                          25245      "%$99,999"      $25,245
  175.                 
  176.                          -5643     "%$999,999"      $-5,643
  177.                 
  178.                 Alphanumeric  Editing   Masks   may  be  used  to  cause
  179.                 predefined characters to be imbedded within displayed or
  180.                 printed  alphanumeric  items.   Alphanumeric  items  are
  181.                 identified in the data dictionary with the character "c"
  182.                 following the data name.   The  mask must be constructed
  183.                 as an alphanumeric literal whose first character is "%".
  184.                 
  185.                 Examples:
  186.                 
  187.                      Input Values        Mask        Output
  188.                 
  189.                        123456789     "%@@@-@@-@@@@"  123-45-6789
  190.                 
  191.                        102786        "%@@/@@/@@"     10/27/86
  192.                 
  193.        
  194.        Here is an example of a more complex query construction:
  195.        
  196.        
  197.        SELECT:
  198.        (EC = "UE" or "UW" or "UP") and Date = "????86" and Type = "C"
  199.        
  200.        
  201.        SORT:
  202.        EC
  203.        
  204.        
  205.        REPORT:
  206.        print   Date   Payee   EC   Amount   "%9,999,999.99"   bottom(EC)
  207.        total(Amount) "%9,999,999.99"
  208.        
  209.        
  210.        This query  selects  transactions  with  Expense Codes of "UE" or
  211.        "UW" or "UP" that have a Date  ending  with "86" that also have a
  212.        Type of "C".  Note that the  question  mark (?) is used as a wild
  213.        character, i.e., it  is  used  to  denote  "any  character".  The
  214.        output report is to be printed and  will contain the Date, Payee,
  215.        Expense Code and Amount.  A total  will be printed when there has
  216.        been a change in the expense code.
  217.        
  218.        Rules:
  219.        
  220.             (1)  The Select statement may contain these operators:
  221.        
  222.                     =  Equal to
  223.                     <> Unequal to
  224.                     <  Less than
  225.                     >  Greater than
  226.                     <= Less than or equal to
  227.                     >= Greater than or equal to
  228.        
  229.             (2)  The field on the left side  of  the  operator must be a
  230.        data name from the dictionary.
  231.        
  232.             (3)  The field on the  right  side  of  the  operator may be
  233.        either a data name or  literal.    Literals  must  be enclosed in
  234.        double quotes.
  235.        
  236.             (4)  In the case of equal and unequal,  the data name on the
  237.        left side of the operator is searched  for any occurrences of the
  238.        data specified on the right of the operator.
  239.        
  240.             (5)  The length of the item to the right of the operator may
  241.        not be greater than the  length  of  the  item to the left of the
  242.        operator.
  243.        
  244.             (6)  When used in a literal, the "?"  is wild.  For example,
  245.        to select all records in the database enter:
  246.        
  247.                    SELECT:
  248.                    Date  = "?"
  249.        
  250.             (7)  Commas may used to improve readability; otherwise, they
  251.        serve no useful purpose.
  252.        
  253.             (8)  All data names must be capitalized.  All other commands
  254.        must be in lower case.
  255.        
  256.        If your printer carriage is 80 columns in width, try setting your
  257.        printer preferences for compressed mode in order to print reports
  258.        that are greater than  80  characters  in  width.   Also, if your
  259.        printed output does not have the expected  appearance, check your
  260.        printer preferences.
  261.