Kore Tech Tip
How to SELECT Today's Records in U2
Tip
#1012

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.
  1. 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
    
  2. 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:
    0001: PQ
    0002: C List Today's Sales Orders
    0003: RI
    0004: HTODAYS.DATE
    0005: P
    0006: HSORT SO
    0007: H WITH DATE =
    0008: A"1
    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
    0013: P
    
    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.
    *
    
      TODAY=OCONV(DATE(),'D2-')
      PROCREAD PROC.BUF ELSE PROC.BUF=""
      IF PROC.BUF # "" THEN
      PROCWRITE BUF:CHAR(32):TODAY
      END ELSE
        PROCWRITE TODAY
      END
    *
    
    END
    
    * 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
 
 
 
Our technical tips are provided to help you find new or easier ways to solve some of your technical challenges or to show you a new technique. We hope you find them useful. Please contact us if you would like to share one of your Tech Tips or need help solving a technical challenge. We would be happy to help you.