Syntax 1: For DateTime data and blobs
Description
Extracts a date from a DateTime value or from a blob whose first
value is a date or DateTime value.
Syntax
|
1 |
Date ( datetime ) |
|
Argument |
Description |
|---|---|
|
datetime |
A DateTime value or a blob in which the first value is a |
Return value
Date.
Returns the date in datetime as a date. If datetime contains an
invalid date or an incompatible datatype, Date returns 1900-01-01. If
datetime is null, Date returns null.
Examples
After a value for the DateTime variable ldt_StartDateTime has been
retrieved from the database, this example sets ld_StartDate equal to the
date in ldt_StartDateTime:
|
1 2 3 |
DateTime ldt_StartDateTime date ld_StartDate ld_StartDate = Date(ldt_StartDateTime) |
Assuming the value of a blob variable ib_blob contains a DateTime
value beginning at byte 32, the following statement converts it to a
date value:
|
1 2 |
date ld_date ld_date = Date(BlobMid(ib_blob, 32)) |
See also