dmhopkins
asked on
how to default current date when selecting records in wrkqry
This is such a beginners question that I'm almost ashamed to ask but I'm gonna anyway. I am building a query using wrkqry in an AS/400 environment. I want to check a file date against the current system date. Does wrkqry recognize the system date? If so what do I call it in my "Values" field.
Thanks All.
Thanks All.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Guys thank you so very much! I got it now just needed you to remind me where to begin. By the way the dates are defined in DATE format so I was able to use both your examples to get what I needed. You two ROCK!!!!!!!
In that case, current(DATE) was the answer you needed, so points to Barry, please.
- Gary
- Gary
ASKER
Duely noted. Thank you both for taking the time to answer my putzy question. And Barry thank you for giving me the answer I needed.
You're welcome. No such thing as a putzy question.
Take care
Barry
Take care
Barry
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
The current() function returns a value in DATE, TIME, TIMESTAMP format, depending on the parameter you select.
If your date is stored in DATE format, you can you can just compare to current(date). If it is in numeric or character format, you have to do a bit more work to get both the system date that you get from current(). In Barry's example above, he uses the CHAR function to convert the TIMESTAMP returned by current() to CHAR format. Dates stored in numeric format are even trickier, and generally require that you convert the numeric date into DATE format using a combination of DIGITS, concatenation, and DATE functions.
If you'll post back with the date format that you need to compare, we can give you a specific example.
- Gary Patterson