10 9 8 AsValue

LANSA Technical

10.9.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 ((#Datetime.IsSqlNull) *or (#Datetime = #Datetime.now))

 

Endif

 

Using AsValue it can be coded as follows

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

 

Endif

 

Ý 10.9 DateTime Intrinsic Functions