Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1168
  • Last Modified:

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
0
Kimster1991
Asked:
Kimster1991
  • 5
  • 5
  • 4
  • +1
1 Solution
 
rockiroadsCommented:
Taking a guess, is there AddMonths?

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

Conthist->Createon<=(AddYears(-2,Add6Month(Date())))
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
rockiroadsCommented:
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
0
 
Kimster1991Author Commented:
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?
0
 
rockiroadsCommented:
Curse the damn product for not having the flexibility

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

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

Add1Month
Advance a Date {x} true MONTHs
0
 
jrb1Commented:
(assuming it applies)
0
 
Kimster1991Author Commented:
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
0
 
Kimster1991Author Commented:
Uh...hmmm...how do I close this question out now?
0
 
rockiroadsCommented:
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

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

0
 
jrb1Commented:
that's fine
0
 
NetminderCommented:
Closed, 500 points refunded.
Netminder
Site Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 5
  • 5
  • 4
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now