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<=(AddYe ars(-2,Dat e()))
Your assistance is greatly appreciated!
Kimster1991
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<=(AddYe
Your assistance is greatly appreciated!
Kimster1991
Taking a guess, is there AddMonths?
ASKER
LOL..no. Tried AddMonth and AddMonths..neither are valid boolean expressions.
how about this:
Conthist->Createon<=(AddYe ars(-2,Add 6Month(Dat e())))
Conthist->Createon<=(AddYe
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
http://www.redstonesoftbase.com/index_000001.htm
I cant see anything with months
ASKER
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?
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! :)
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
http://www.redstonesoftbase.com/index_000001.htm
Add1Month
Advance a Date {x} true MONTHs
(assuming it applies)
ASKER
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->Ondat e, -12)
Result: 07/01/2005
FirstOfMon(Conthist->Ondat e, -18)
Result: 01/01/2005
FirstOfMon(Conthist->Ondat e, -24)
Result: 07/01/2004
Addendum:
The actual Filter might be:
Conthist->Ondate < FirstOfMon(Conthist->Ondat e, -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
Examples assume Conthist->Ondate, and that it is today's date. This would be all, or part of, your Filter:
FirstOfMon(Conthist->Ondat
Result: 07/01/2005
FirstOfMon(Conthist->Ondat
Result: 01/01/2005
FirstOfMon(Conthist->Ondat
Result: 07/01/2004
Addendum:
The actual Filter might be:
Conthist->Ondate < FirstOfMon(Conthist->Ondat
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
ASKER
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
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
ASKER
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.