Link to home
Start Free TrialLog in
Avatar of Kimster1991
Kimster1991

asked on

Subtract 18 months from today's date

Hi,
I am working with a DOS program that is extracting data from a GoldMine dBase IV program with Boolean Expressions. I need to archive history for the last 18 months from today's date.  We are able to use the Year function for going back 2 years, but now we need to be able to extract data in monthly increments.

Do you know what Boolean expression I would use?

This is the 2 year expression that we are successful with.

Conthist->Createon<=(AddYears(-2,Date()))

Your assistance is greatly appreciated!

Kimster1991
Avatar of rockiroads
rockiroads
Flag of United States of America image

Taking a guess, is there AddMonths?

Avatar of Kimster1991
Kimster1991

ASKER

LOL..no. Tried AddMonth and AddMonths..neither are valid boolean expressions.
how about this:

Conthist->Createon<=(AddYears(-2,Add6Month(Date())))
I found this site, dont know if it applies to you though
http://www.redstonesoftbase.com/index_000001.htm

I cant see anything with months
There is no AddMonth function. I will try jrb1's ...but if it won't add months in the beginning, not sure why it would add in the middle of the expression.

Yes, Redstone is the developer and I have an email in to Dave for assistance as well. Any other suggestions?
Curse the damn product for not having the flexibility

But I guess you've already tried that one! :)
That's the syntax of the AddMonth function:

http://www.redstonesoftbase.com/index_000001.htm

Add1Month
Advance a Date {x} true MONTHs
(assuming it applies)
You guys are dolls for attempting to help me on this! I really did need to get this resolved today. Dave provided me with the following:

Examples assume Conthist->Ondate, and that it is today's date.  This would be all, or part of, your Filter:
 
FirstOfMon(Conthist->Ondate, -12)
Result: 07/01/2005
 
FirstOfMon(Conthist->Ondate, -18)
Result: 01/01/2005
 
FirstOfMon(Conthist->Ondate, -24)
Result: 07/01/2004
 
Addendum:
 
The actual Filter might be:
 
Conthist->Ondate < FirstOfMon(Conthist->Ondate, -24)
 
And you'd run them biggest to smallest, if they want these as 3 separate data sets.  Otherwise, if you ran -12 first, that would pick up ALL of them (everything less than a year ago).
 
This is compliments of Dave Petonic, Developer and GoldBox God...

Thanks all!

Kimster
Uh...hmmm...how do I close this question out now?
Nice, your sorted!

Post a question in community support asking them to close this. You will get a refund in points
I dont recommend you request delete as your info may be of some use to other people

Thanks Rockroads. I have asked them to close it but to leave it up for others. Appreciate the help on getting it closed!
Please close instead of delete, the information here may prove useful to someone

that's fine
ASKER CERTIFIED SOLUTION
Avatar of Netminder
Netminder

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial