This is a public Forum  publicRSS

Forum post

    Pec Cars
    Where do I pull the current date for calculations, searches...Answered
    Forum post posted February 28, 2011 by Pec Cars , last edited February 9, 2012
    535 Views, 1 Comment
    Where do I pull the current date for calculations, searches and so on ?

    I couldn't find a function for obtaining the current month. As this is a basis for many of the calculations in my app, what I have done is created a global variable called $$CurrentMonth that I use throughout the app. Is there a way of calculating the current month from // ? or something similar ?

    Best Answer


    If you want the number for the current month, use Month ( Get ( currentDate ) ). If you want the name of the current month, use MonthName ( get ( CurrentDate ) ).

    You may also find one of these calculations in a calculation set to return date useful:

    DateField - Day ( DateField ) + 1

    Date ( Month ( Datefield ) ; 1 ; Year ( Datefield ) )

    Both return the date of the first day of the same month and year as the date in DateField and such a field can be useful for searches, sorts and as a relationship key for working with all records of the same month and year.