10 8 8 AsValue

LANSA Technical

10.8.8 AsValue

AsValue allows you to better handle *SQLNull. Rather than having to test for a potential SQL null, AsValue allows a variable to return a specified value.

Input Parameters

Default - The value to be returned when the variable contains an SQLNull.

Allowable values for a date variable are any valid dates

Example

The IF below tests for the date as SQLnull or today's date

 

If ((#Date.IsSqlNull) *or (#Date = #Date.now))

 

Endif

 

Using AsValue it can be coded as follows

 

If (#Date.AsValue(#Date.now) = #Date.now)

 

Endif

 

Ý 10.8 Date Intrinsic Functions