Professional Web Applications Themes

Rounding a Date to the 1st Day of the month - FileMaker

Hi there i'm having problems trying to get a calculation to work. 2 fields an End date and a Renew Date. The end date is manually entered and the renew date calculates the end date + 365. What i need it to do is to have it always calculate to the first of the month. i.e. - End Date = 2/24/2004 Renew Date= 2/01/2005. Is there any easy way to do this. any help is definitely appreciated....

  1. #1

    Default Rounding a Date to the 1st Day of the month

    Hi there i'm having problems trying to get a calculation to work. 2
    fields an End date and a Renew Date. The end date is manually entered
    and the renew date calculates the end date + 365. What i need it to do
    is to have it always calculate to the first of the month. i.e. - End
    Date = 2/24/2004 Renew Date= 2/01/2005. Is there any easy way to do
    this. any help is definitely appreciated.
    Mikey Guest

  2. #2

    Default Re: Rounding a Date to the 1st Day of the month

    Mikey P wrote:
     

    Using a strict 365 day addition (i.e. not accounting for leap year - Feb
    29, 2004 would have a renew date of March 1, 2005):

    Calc field returning date: Renew Date = Date(Month(End Date + 365), 1,
    Year(End Date + 365))

    Or, to account for leap years (Feb 29, 2004 would have a renew date of
    Feb 1, 2005):

    Renew Date = Date(Month(End Date), 1, Year(End Date) + 1)

    (I may have the order of month and day mixed up, but that's the right
    function)

    Kevin Guest

  3. #3

    Default Re: Rounding a Date to the 1st Day of the month

    Try this..

    Date( Month(EndDate), 1 , Year(EndDate) + 1 )

    But a EndDate that is 2/1/2004 will give you a RenewDate of 2/1/2005 your
    losing the 23 day grace period as in your example.

    Ted

    "Mikey P" <com> wrote in message
    news:google.com... 


    Ted Guest

Similar Threads

  1. Start and end date of month
    By ccnorris in forum Coldfusion - Advanced Techniques
    Replies: 4
    Last Post: July 19th, 08:46 PM
  2. Query distinct month and date
    By LKnomad in forum Dreamweaver AppDev
    Replies: 0
    Last Post: April 12th, 08:32 PM
  3. Last Date of previous month
    By navdeep virk in forum Informix
    Replies: 9
    Last Post: November 11th, 02:47 PM
  4. Replies: 1
    Last Post: July 17th, 02:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139