Selecting "Today's" Records in UniData and UniVerse
How many of us would like to have a list of what was entered today, what's due today, or what shipped today? I imagine there are a couple of us anyway. Here are 2 easy ways to get such a report. We'll use Sales Orders entered Today for our examples.
- This example may be useful as a wIntegrate Query. The idea here is to use a dict item that will compare today's date with that on a record. I created a dict item, Z_TODAYS_ORDERS, with the following v-code:
IF (DATE()=F1) THEN 1 ELSE ""
Using Info/Access, I can now select and list those Sales Order entered today:
SORT SO WITH Z_TODAYS_ORDERS BY SOLD_TO_NAME SO_NO DATE SOLD_TO SOLD_TO_NAME TOTAL SO_AMT HEADING"'T' Sales Orders for Today 'L'" ID-SUPP
- This example uses a PROC to call a program that will place the current date into the PROC buffers (I used the first buffer position) and then run an Info/Access statement which will pick up our records by comparing the record dates to the date in the proc buffer:
0002: C List Today's Sales Orders
0006: HSORT SO
0007: H WITH DATE =
0009: H BY SOLD_TO_NAME
0010: H SO_NO DATE SOLD_TO SOLD_TO_NAME TOTAL SO_AMT
0011: H HEADING "'T' Sales Orders for Today'L'"
0012: H ID-SUPP
Here's that little program which places today's date into the next available PROC buffer, note you may need to modify the buffer delimiter for your system.
* PROGRAM : TODAYS.DATE
* PURPOSE : Place Today's Date to a PROC in output format.
PROCREAD PROC.BUF ELSE PROC.BUF=""
IF PROC.BUF # "" THEN
* DataFlo users there is a PROC subroutine called TODAY which will place the current date into the PROC buffers.
DataFlo is a product, copyright, and trademark of Epicor Corporation