Manage Learn to apply best practices and optimize your operations.

Year and quarter -- the LotusScript way

How to show when a doc was created in the format Year, Qx -- using LotusScript.

This tip is useful for reporting purposes. It shows when a document has been created in the format 2003 Q1, 2003 Q2 etc. It uses the New Zealand tax year as its base calculation, which begins in April. Therefore, any document created in months 1, 2 or 3 will show as Q4 for the previous year.

Sub DoQuarter ( doc As NotesDocument)
  Dim mtmp As Integer
  mtmp = Month(Now)
  Dim ytmp As Integer
  ytmp = Year(Now)
  ' if it is the first quarter then the tax year is the previous year
  If  mtmp < 4 Then
    ytmp = ytmp -1
  End If
  Select Case mtmp
    Case 1 To 3
      doc.ClosedQuarter = Cstr(ytmp) & " Q4"
    Case 4 To 6
      doc.ClosedQuarter = Cstr(ytmp) & " Q1"
    Case 7 To 9
      doc.ClosedQuarter = Cstr(ytmp) & " Q2"
    Case 10 To 12
      doc.ClosedQuarter = Cstr(ytmp) & " Q3"
  End Select
End Sub


Do you have comments on this tip? Let us know.

This was last published in October 2003

Dig Deeper on Domino Resources

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchExchange

SearchContentManagement

Close