#

# LogiView

## Function 'sel_date'

| This function is used to select a database value from the database. The corresponding database field must be the type "Date".
| If the function is called using the Where clause "actual', LogiView tries to read the table field value from the current mask.
| If the number of values which are returned by the where clause is unknown, it is absolutely necessary to call sel_value(count) and proceed with the programming depending on the result. If the result > 1 , an array must be read-in. Example: RES=sel_value(count({FLD}),{WHERE|actual}) if(RES==0) put("No result") elseif(RES==1) {DAT_VAR}= sel_date({FLD},{WHERE|actual})else else {DAT_VAR}= sel_date({FLD},{WHERE|actual})else endif
| ### Syntax:
| {DAT_VAR}= sel_date({FLD},{WHERE|actual}) or {DAT_VAR}= sel_date(act_fld)
| ### I/O parameters:
| {FLD} | Name of a table field in the format "table name.column name".
| {WHERE|actual} | Where clause followed by the database access.
| act_fld | The keyword "act_fld" defines the access to the current (mask) field without the necessity to know its name. "Act_fld" represents a unique and complete Where clause; therefore, using further Where clauses is excluded. "Act_fld" can only be used if LogiView is called as "pre-field" or "post-field" userexit.
|  | In this case no database access is necessary. However, the mask contents may vary from the actual database contents unless an update was performed just before.
| - |
| ### Return value:
| {DAT_VAR} | Value read from the database.
| Functions and commands: DB/Mask Interface