Examples:
From the [preferences] section of Sales32c.INI:
AutoRecall="first_name,last_name,descrip1,orig_dt,balancedue FROM sh_save
WHERE date_time > DATETIME(YEAR(DATE()), MONTH(DATE()), DAY(DATE())-1)
.AND. '<GROUP>' $ RECALL1 .AND. '<SUBGROUP>' $ recall2 .AND. operator =
'<OPERATOR>' .AND. salespoint = '<SALESPOINT>' .AND. finalized = .F. AND
reserv_no = 0 ORDER BY balancedue DESC"
Any of the fields in the sh_save table may be used in the query. The contents of the specified fields are either displayed on the buttons in the button grid or as columns in the list format.
Common fields include first_name, operator, salespoint,date_time and orig_dt. Autorecall does not work for Reservations module when using shared data.
If one of the following tags is found in the query string, it will be replaced with its corresponding value when the query is executed:
<OPERATOR>,<SALESPOINT>,<GROUP> and <SUBGROUP>
Note: The tags are case sensitive, and must be upper case.
To filter on a date field, use the DATETIME function: DATETIME( Year, Month, Day [,Hour[, Minute [, Second ] ] ] ).
• To query for all records where the DateTime field (called ORIG_DT) falls between noon and two o'clock on December 31, 2001, use the following: "ORIG_DT >= DATETIME(2001, 12, 31, 12) .AND. ORIG_DT < DATETIME(2001, 12, 31, 13, 59, 59)"
• DATETIME(YEAR(DATE()), MONTH(DATE()), DAY(DATE())) will retrieve today’s date (with a default time of midnight)
• DATETIME(YEAR(DATE()), MONTH(DATE()), DAY(DATE())-1) will retrieve yesterday’s date.
For example, to automatically generate a list of all open non-reservation sales for a given operator and group within the last 24 hours, specify the following in the Sales32c.INI file:
AutoRecall = first_name, descrip1, orig_dt FROM SH_SAVE where date_time > DATETIME(YEAR(DATE()), MONTH(DATE()), DAY(DATE())-1) .AND. '<GROUP>' $ RECALL1 .AND. operator = '<OPERATOR>' .AND. finalized = .F. .AND. reserv_no = 0
This will expand to select first_name, descrip1, orig_dt FROM SH_SAVE where date_time > DATETIME(9/30/2010) .AND. 'FOODTS' $ RECALL1 .AND. operator = 'BOB' .AND. finalized = .F. .AND. reserv_no = 0 when the query is executed.
To add the additional restriction of the salespoint name and subgroup, add .AND. ‘<SUBGROUP>’ $ RECALL2 .AND. salespoint = '<SALESPOINT>':
AutoRecall = first_name, descrip1, orig_dt FROM SH_SAVE where date_time > DATETIME(YEAR(DATE()), MONTH(DATE()), DAY(DATE())-1) .AND. '<GROUP>' $ RECALL1 .AND. '<SUBGROUP>' $ RECALL2 .AND. operator = '<OPERATOR>' .AND. finalized = .F. .AND. reserv_no = 0 .AND. salepoint = ‘<SALESPOINT>’
Notes:
• The query does not begin with the SELECT statement. The query starts with the field names.
• The like or contains operator, “$”, uses a different argument order than other operators. The left-hand argument is the string that you are seeking, and the right-hand argument is the string or field in which you are seeking. In the above examples we are searching for all the values in the field RECALL1 which contain the current group: ‘<group>’ $ RECALL1. For an exact match, use the equal operator ,’=’: operator = ‘<operator>’.
• The AND & OR clauses are entered as .AND. & .OR
• TRUE and FALSE are represented by .T. & .F. Using ‘1’ for true and ‘0’ for false is NOT supported.