Solved

Subtract 18 months from today's date

Posted on 2006-07-14
17
821 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
  • 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
 
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Read about achieving the basic levels of HRIS security in the workplace.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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…

705 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now