× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Query400 question
  • From: "Bill Robins" <brobins3d@xxxxxxxxx>
  • Date: Thu, 17 Feb 2000 08:21:53 -0800

Andreas, (and everyone else)

Date manipulations are simple in Query/400 once you understand the logic
behind them.  I have taught the concept to many here at my company and it
works well.

As Al mentioned in one of his posts, BPCS stores dates in CCYYMMDD format so
I will show examples on how to manipulate that type of date, but remember it
will work just as well for date fields in ANY format.  -- Let's use an
example of wanting to know which ECL lines have a schedule date of
"tomorrow".

First, create a character field out of the numeric date field.
LSDTEA          digits(lsdte)

Now, format this character field into the *ISO format for a date field.
LSDTEAA       substr(lsdtea,5,2) || '/' || substr(lsdtea,7,2) || '/' ||
substr(lsdtea,3,2)

(Now understand what just happened, LSDTEAA now looks like MM/DD/YY)

Now, turn this formatted field into a true date type field.
LSDTED           date(lsdteaa)

Now, since we need to calculate days difference, let's get a number of days
from this field.
LSDTEDYS      days(lsdted)

Now, find out "tomorrow's" date.
TOMORROW  days(current(date)) + 1

Now just enter the criteria in the Select Records Screen.
LSDTEDYS      EQ     TOMORROW

As you can see, once you get the logic behind the conversions, you have
quite a bit of power at your fingertips.  (For more information see the
Query/400 manual's index entry  date/arithmetic operation/converting numeric
to date).

Bill



> I have a field in format date  (DD/MM/YY) and I would like to create a new
> field containing the original date  plus 1 day.



__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

+---
| This is the BPCS Users Mailing List!
| To submit a new message, send your mail to BPCS-L@midrange.com.
| To subscribe to this list send email to BPCS-L-SUB@midrange.com.
| To unsubscribe from this list send email to BPCS-L-UNSUB@midrange.com.
| Questions should be directed to the list owner: dasmussen@aol.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.