Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Subtract 18 months from today's date

Posted on 2006-07-14
17
Medium Priority
?
1,019 Views
Last Modified: 2006-11-18
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
Comment
Question by:Kimster1991
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 4
  • +1
17 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 17110949
Taking a guess, is there AddMonths?

0
 

Author Comment

by:Kimster1991
ID: 17110964
LOL..no. Tried AddMonth and AddMonths..neither are valid boolean expressions.
0
 
LVL 25

Expert Comment

by:jrb1
ID: 17111103
how about this:

Conthist->Createon<=(AddYears(-2,Add6Month(Date())))
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 65

Expert Comment

by:rockiroads
ID: 17111226
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
 

Author Comment

by:Kimster1991
ID: 17111304
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
 
LVL 65

Expert Comment

by:rockiroads
ID: 17111330
Curse the damn product for not having the flexibility

But I guess you've already tried that one! :)
0
 
LVL 25

Expert Comment

by:jrb1
ID: 17111563
That's the syntax of the AddMonth function:

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

Add1Month
Advance a Date {x} true MONTHs
0
 
LVL 25

Expert Comment

by:jrb1
ID: 17111566
(assuming it applies)
0
 

Author Comment

by:Kimster1991
ID: 17111826
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
 

Author Comment

by:Kimster1991
ID: 17111834
Uh...hmmm...how do I close this question out now?
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17111849
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
 

Author Comment

by:Kimster1991
ID: 17111961
Thanks Rockroads. I have asked them to close it but to leave it up for others. Appreciate the help on getting it closed!
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17117976
Please close instead of delete, the information here may prove useful to someone

0
 
LVL 25

Expert Comment

by:jrb1
ID: 17118717
that's fine
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 17157095
Closed, 500 points refunded.
Netminder
Site Admin
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question