Solved

Subtract 18 months from today's date

Posted on 2006-07-14
17
932 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
Industry Leaders: 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
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…

728 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