Hi
another way is by a view in sql
CREATE VIEW mylib/myview AS SELECT * FROM mylib/myfile WHERE mydatefield = current date
you can then:
runqry *n mylib/myview
which will only display records for toays date.
I have a set of UDF's that will convert numerics in to date fields if the fields are not held as date formats although thos does have a performance impact.
Dave
Main Topics
Browse All Topics





by: Gary_The_IT_ProPosted on 2009-09-29 at 07:04:59ID: 25449136
You just need to get both dates into the same format.
YYYYMMDD,5 ,2) || '/' || ,2) || '/' || ,2))
*10000) + ) +
TS H
e.com/M_43 82324.html
CURRENT(DATE) returns a DATE field (DDS type "L"). If the dates in your table are stored in "L" format, then a simple comparison will work. If they are in a different format, then you will need to convert one side of the equation to match the other.
For example, it is fairly common to store dates in a numeric field in yyyymmdd format. You either need to convert this to DATE format, or convert CURRENT(DATE) to numeric format.
Assume that the job date format is MDY (USA style) and the date separator is "/", then:
DATE(SUBSTR(DIGITS(my
SUBSTR(DIGITS(myYYYYMMDD,7
SUBSTR(DIGITS(myYYYYMMDD,3
If is is stored in a character field in the same format, you just drop all of the DIGITS functions.
Of course, You'll have to rearrange and substitute correct date separators to match your job date.
To go the other way (DATE to numeric), you could:
(YEAR(CURRENT(DATE))
(MONTH(CURRENT(DATE))*100
(DAY(CURRENT(DATE)))
The functions that you need to use for date conversions typically include:
DATE
CHAR
SUBSTR
DIGI
YEAR
MONT
DAY
If you need more help, post the data type and format of the dates in your table, please, and we can give you specific advice.
- Gary Patterson
Check out my EE profile: http://www.experts-exchang