Overview of Dates
Date values are a specific type of data that can be manipulated like numbers and formatted to appear in different styles. A date value (we’ll just call it a "date") usually appears on screen in the familiar format of "11/29/2009", and can be stored in a field in your database. Dates can be displayed on screen or in reports in many other formats, including "November 29, 2009". You might manipulate dates when you want a date calculation in a report, query, or form, or to show the age of people in your Name window if you have a field storing their birthdays.
NOTE: To understand this discussion, you should read the section on expressions and make sure you understand its concepts—especially in using functions. All the places in Abacus where you manipulate dates are places where you are editing expressions.
Date Fields
Date fields are simply fields in Abacus databases that hold dates. They have a name that can be used in expressions. Some common date fields used in Abacus include:
-
Opened: Represents the date a matter was opened.
-
Closed: Represents the date a matter was closed.
Date Variables
A date variable is like a field but is not stored in a database. It is a name that holds a value. The most common date variable used in Abacus is Today. Today represents your logged-in date. For example, if the date you logged in to Abacus is January 1, 2016, Today is 1/1/2016.
Anywhere a date type field could go, you can use the variable "Today" for today's date.
"The date is " + DToC(Today)+ ", which is today."
You can use Today in queries. For example, a query for "All matters entered or changed Today" would test the Matters->Entry field (which is automatically stamped whenever a matter is added or edited) against Today. In the Query Builder, edit the expression and enter Today into the Value field.
Date Math and Date Functions
To manipulate dates, date variables and fields can be used in date math and in date functions:
Date math involves performing simple calculations with dates, like subtracting one date from another to find the "days between" or adding a number to a date to get a later date.
Date functions are used when you want to extract part of the information from a date (such as its month name), or format date information to appear in various ways. In the first case, a date is passed to a function and the month name is returned (or the year, or day number, depending on the function), In the second case, a date value is passed to a function that converts it to the desired character text. This can even be as verbose as "this Twenty-ninth day of November, Two thousand and Nine".
NOTE: In addition to date math and date functions, in the Screen Designer, you can set a date field to always show the 4-digit year with century by setting the Picture property to @4. This is handy for showing birthday fields that may be before the year 2000. Click here for more information about the Picture property on the Screen Designer.
Date Manipulation Examples
Click here for some examples of how date fields can be manipulated to get the information you need to see.
TIP: Date Field Shortcut Keys
There are special keyboard shortcut keys that are active when editing a date field. They can help save time when working with dates. Click here for more information.