× 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.





Hello Everyone,

Can anyone suggest how to compare two date fields?

I have a database file field DATE1 - defined as type 'L'

In the program I am using a field DATE2 datatype 'D' DATFMT(*ISO)

In the program,I am moving the value of *Date to DATE2

Now when I try to compare these two dates -

If DATE1 < DATE2

Endif

I receive a compile time error as-

*RNF7421 30 1 Operands are not compatible with the type of operator.

Any suggestions? I was assuming it to be compatible since both the fields are date datatypes.

Also, I want data from the database only from the past 2 yrs and starting from the 1'st day of July of that yr. I can subtract the year by using Subdur as follows -

Date2 Subdur 2:*Years Date3

How can I set a compare value of date to start from '2006-07-01' if todays date is '2008-06-23'?

The solution I have in mind is check for todays month -

And accordingly subtract the no of months by using Subdur depending on todays month.

Does anyone have a better solution for starting the month from 1'st of July 2 years previous?


Thanks in advance for all your suggestions and help,

Derek







_________________________________________________________________
The i’m Talkathon starts 6/24/08.  For now, give amongst yourselves.
http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.