How to Create Default Values Using a View The default value can use keywords to retrieve systems values as follows:ģ. How to Use a System Value as a Default Value The user can accept the default value, enter a date, or select a different start date from the drop-down calendar.Ĭurrent year: SQL(ZONED(year(Current date),4,0))ġst of the month: SQL(cvtdate(year(current date),month(current date),01))ġst of last month: SQL(cvtdate(year(current date-1 month), month(current date-1 month), 01))Įnd of last month: SQL(cvtdate(year(current date), month(current date), 01)- 1 day) 2. When end users run the view, a run-time prompt window appears. By adding the expression SQL(current date - 1 year) as your default, the view automatically uses the date from one year ago for its start date. The expression or field should return a character, zoned, or date field. If you don’t specify a default value, both date values will be defined as the current date, which will force end users to choose dates from a calendar or enter values manually. In this example, our view will select records whose dates fall between the dates specified by your run-time variables (&startdate, &enddate). WHERE pdate between "&startdate" and "&enddate" The following view was created using the CUSTMAST file in the SEQUELEX library: You can use an expression in the default value to determine the date one year ago and use it as your start value. Suppose you’re creating a Sequel view or report that automatically includes data from the last year of activity. How to Create a Default Value Using an Expression or System Value
Not using Sequel? Request a demo to see how run-time prompts work.Īlready using Sequel? Here are four tips and tricks for building run-time prompted views. Plus, it allows you to set variable values for batch and scheduled jobs dynamically. This makes it easy for end users to run requests for commonly selected variables.
Here's how: when selecting default values, you can choose expressions from a SQL statement or view, or you can use fields from a database file.