Handling Dates in Argos

On this page you will find information on date controls and how date formatting works in Argos.

Date Edit Control
Working with dates in SQL
Date formats and how they are used
Tips for working with dates in SQL


Date Edit Control

This image shows the calendar that is displayed when adding a Date Edit Control to the form.

The Date Edit control allows you to collect date input from a user. The user can either type in a date, or click the icon to bring up a calendar. Date display format is controlled by the local PC regional settings, although the date itself is handled internally in a standard format regardless of local PC settings. In the Web Viewer, the date format the user sees is determined by the language settings in their browser (for Chrome and Firefox) or by their local OS regional settings (Internet Explorer).

Date Edit objects support the ability to default "today" or a fixed date and to define first day of the week. When you add a Date Edit control to a form, it assigns a default variable name, "DateEdit1" to the control. You may choose a more descriptive name, but don't use spaces or special characters.

Date controls can also be set to be data aware. This means you can assign any date field from existing SQL Variable to populate this object. Simply assign the Data Aware property for the date control to one of the available date fields.

The variable associated with a Date Edit control is of type datetime, which includes a time component. When a user specifies a date using a Date Edit control, it sets the time to be 12:00 AM (midnight) on that date. You may wish to truncate the time portion of the datetime when using the date variable in your queries.

Working with dates in SQL

Depending on your connection configuration, you may need to explicitly convert a date object to a date in your SELECT clause using the TO_DATE function. Check with your administrator to determine how the data connection is configured.

Example (using the TO_DATE function):

Set the format to the short date format of the server.

select SPBPERS.SPBPERS_BIRTH_DATE,

F_CALCULATE_AGE(TO_DATE(:DateEdit1,'MM/DD/YY'), SPBPERS_BIRTH_DATE, NULL) AGE1,

from SATURN.SPBPERS SPBPERS


Date formats and how they are used

Depending on when, where and how you use a date, it may be represented in different formats.

When using a database field in:

Location Format used by system
Parameter in a control on a form Regional Settings
SQL SELECT Statement Short date format
Banded Report Short date format
CSV Report Short date format


When using a Date Edit Control as a variable in:

Location Format used by system
SELECT Statement Short date format
Banded Report Regional Settings
CSV Report Regional Settings

Format Reference

Tips for working with dates in SQL

Use the Oracle TRUNC function for dates coming from the database. TRUNC eliminates any time portion of the date value.

 


Need More Help?

If you need additional help creating DataBlocks, refer to the Getting Started with DataBlocks page.