[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]]
==== Can you detect when month and year change (OpenInsight Specific) ====
=== At 06 MAR 1998 03:04:50PM Robert Dunmire wrote: ===
{{tag>"OpenInsight Specific"}}
I'm trying to build and application that uses Month-to-Date and Year-to-Date accumulators. In the perfect world I would have the system detect when the month or year change and prompt the user to run a report and then code a routine to zero out the appropriate accumulators after the report was run.
In our imperfect world am I asking to much for the system to detect a change in month or year? If I'm not asking too much of the application, can you give me a hint as to where to start!
Thanks
----
=== At 06 MAR 1998 06:43PM Cameron Revelation wrote: ===
Robert,
[i]I'm trying to build and application that uses Month-to-Date and Year-to-Date accumulators. In the perfect world I would have the system detect when the month or year change and prompt the user to run a report and then code a routine to zero out the appropriate accumulators after the report was run.[/i]
I don't understand the question ... however, this might help. To determine if two dates are in to different months/years:
function GetYear(Date)
return fmt(Date, "DJ4")1,4
function GetMonth(Date)
return fmt(Date, "DFS")1,2
function GetYearMonth(Date)
return fmt(Date, "DJ4S")1,7
So to compare if two dates are in different months:
if GetYearMonth(Date1) # GetYearMonth(Date2) then ...
Hope it helps!
Cameron Purdy
info@revelation.com
----
=== At 06 MAR 1998 08:58PM Andrew P McAuley wrote: ===
On the create event of the login window check a parameter file. If the month is the same as last time continue. If not run the routine and reset the parameter file month. Include locking where appropriate...
amcauley@sprezzatura.com
[url=http://www.sprezzatura.com]Sprezzatura Ltd[/url]
[i]World Leaders in all things RevSoft[/i]
[img]http://www.sprezzatura.com/zz.gif[/img]
----
=== At 06 MAR 1998 10:49PM Robert Dunmire wrote: ===
I believe I can do exactly what I wanted to accomplish with a combination of the data from both of you.
Thanks again.
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=9E97CD6A25C90FB3852565BF006E4E8D|View this thread on the forum...]]