I would like to order the DOB field in my form, based on month and day. How can I do this?

I would like to order the DOB field in my form, based on month and day. How can I do this?

To sort records based on custom value acquired from the DOB field i.e., month and day, you may add a formula field with below suggested sample expression,


((((((DOB.getMonth() / 100).round(2))) + "").getSuffix(".")) + "-") + ((((DOB.getDay() / 100).round(2))) + "").getSuffix(".")
where,
- DOB.getMonth, returns a number in the range (1 -12), representing the number of the month of the year, on which the date occurs.
- DOB.getDay(), returns a number in the range (1 - 31), representing the number of the day of the month on which the date occurs.


The formula expression specified above, returns: [mm]-[dd]. It makes both the month and date, a two digit number. Otherwise ordering goes wrong like: 1, 10, 11, 12, 2, 3, etc.


    • Related Articles

    • I have a form to enter my patient details. Can I create a unique code for each patient based on their DOB and Name combination?

      To create a unique code based on the Date of Birth (DOB) and Name combination, add a Formula field with formula expression as given below, ((((DOB.getMonth())) + Name) + (DOB.getDay())) + (DOB.getYear()) where, - DOB.getMonth, returns a number in the ...
    • Is it possible to obtain month and day information from a given date field?

      Yes, you can use the Deluge date function getDay() and getMonth() to obtain the day and month information. - getDay() returns the numerical day of the month for a particular year. The value returned will be between 1 and 31. - getMonth() returns the ...
    • Work Order Setup

      Request to Work Order Mapping On choosing the Convert to Work Order transition in a Request, the Create Work Order page is displayed with field values pre-filled. Using the Request to Work Order Mapping setting, you can determine the Request field ...
    • Work Order Automation

      Create Work Orders  A  Work Order is a record created for executing a customer service request. A Work Order can be created in one of the following ways: From Requests: Using the Convert to Work Order transition in a Request, a Work Order can be ...
    • Examples of Formula Field

      Formula Fields can be complicated sometimes. So, here are examples that will help you understand the usage of these types of fields in Zoho CRM. IF ELSE Statement Example: If field name contains 'Golf Only 1 Meal', then return 265 ; Else if field ...