This is an advanced tutorial, it does not contain step-by-step instructions on how to build a flowchart. Instead, it describes a sample flowchart which handles dates and times. You should be familiar with SQLphone flowcharting techniques, particularly using the DLL box to call a DLL function (see topic 2.3).
1. Sample Flowchart
Click here to download the sample flowchart for this topic.
To install the sample, create a directory C:\Phone, unzip the sample files into this directory,
and follow the instructions in the unzipped ReadMe file.
The flowchart does this:
2. Support DLL
The sample flowchart uses a DLL (called spfDate.DLL) to verify and format dates and times.
This DLL is included in the sample. If you want to use this DLL in your own flowcharts,
you should read the documentation which describes the DLL's functions.
3. Entering Date & Time
The sample flowchart has 3 Digit boxes, which prompt the caller to enter day, month and year.
The entered values are stored in memories named day, month and year.
(you can use any memory names you like in your own flowchart)
Similarly, the flowchart has 2 Digit boxes, which prompt the caller to enter hours and minutes. The entered values are stored in memories named hour and minute.
4. Validating Date & Time
The sample flowchart has a DLL box, which calls the function GetDate1 contained in the DLL.
This function validates the year/month/day values entered by the caller.
If the date is valid, the function returns the date in format YYYY-MM-DD.
A Play box then speaks the date back to the caller.
Similarly, the flowchart has a DLL box, which calls the DLL function GetTime1. This function validates the hour/minute values entered by the caller. If the time is valid, the function returns the time formatted as HH:MM. A Play box then speaks the time back to the caller.
Notice the various buttons in the Options tab of a Play box. These options allow you to control how SQLphone speaks dates and times. For example, dates can be spoken with or without the day-of-week, times can be spoken in 12 or 24 hour format.
5. SQL with Date & Time
The sample flowchart has a single SQL box (called Log Call), which contains a SQL INSERT statement.
This SQL shows how to insert a date, a time, and a combined date/time into an Access database table.
The SQL statement uses some Access functions (DateSerial, DateTime, Left). If you are using a different database (eg. Oracle), these functions may not be available. You will need to find suitable SQL functions, which convert your memory values into date/time data-types used by your database. Please contact us if you need help.
6. Resources Summary