GetItemDateTime method (DataWindows)
Description
Gets data whose type is DateTime from the specified buffer
of a DataWindow control or DataStore object. You can obtain the
data that was originally retrieved and stored in the database from
the original buffer, as well as the current value in the primary,
delete, or filter buffers.
Separate method names for the Web DataWindow servercomponent
Separate method names, GetItemDateTimeEx, GetItemDateTimeByColNum, and GetItemDateTimeByColNumEx,
are provided as alternative syntaxes for the Web DataWindow server
component, which cannot use overloaded methods.
Controls
|
DataWindow type |
Method applies to |
|---|---|
|
PowerBuilder |
DataWindow control, DataWindowChild object, DataStore |
|
Web |
Server component |
Syntax
[PowerBuilder]
|
1 |
DateTime <span>dwcontrol</span>.<span>GetItemDateTime</span> ( long <span>row</span>, string <span>column</span> <br> {, DWBuffer <span>dwbuffer</span>, boolean <span>originalvalue</span> } )<br>DateTime <span>dwcontrol</span>.<span>GetItemDateTime</span> ( long <span>row</span>, integer <span>column</span><br> {, DWBuffer <span>dwbuffer</span>, boolean <span>originalvalue</span> } ) |
[Web DataWindow server component]
|
1 |
string <span>dwcontrol</span>.<span>GetItemDateTime</span> ( long <span>row</span>, string <span>column</span>)<br>string <span>dwcontrol</span>.<span>GetItemDateTimeByColNum</span> ( long <span>row</span>, short <span>column</span> )<br>string <span>dwcontrol</span>.<span>GetItemDateTimeByColNumEx</span> ( long <span>row</span>, <br> short <span>column</span>, string <span>dwbuffer</span>, boolean <span>originalvalue</span> )<br>string <span>dwcontrol</span>.<span>GetItemDateTimeEx</span> ( long <span>row</span>, string <span>column</span>, <br> string <span>dwbuffer</span>, boolean <span>originalvalue</span> ) |
|
Argument |
Description |
|---|---|
|
dwcontrol |
A reference to the DataWindow control, |
|
row |
A value identifying the row location |
|
column |
The column location of the data. The To get the contents of a computed field, specify the name |
|
dwbuffer (optional) |
A value identifying the DataWindow buffer For a list of valid values, see DWBuffer. |
|
originalvalue (optional) |
A boolean indicating whether you want
If you specific dwbuffer, you must also |
Return Values
Returns the DateTime or Timestamp value in the specified row
and column. Returns null if the column value is null or if there
is no DataWindow object assigned to the DataWindow control or DataStore. Returns
1900-01-01 00:00:00.000000 if any other error occurs.
If any argument value is null, in PowerBuilder the method
returns null.
Usage
Use GetItemDateTime when you want to get information from
the DataWindow’s buffers. To find out what the user entered
in the current column before that data is accepted, use GetText.
In the ItemChanged or ItemError events, use the data argument.
To access a row in the original buffer, specify the buffer
that the row currently occupies (primary, delete, or filter) and
the number of the row in that buffer. When you specify true for originalvalue,
the method gets the original data for that row from the original
buffer.
Datatype mismatch
An execution error occurs when the datatype of the DataWindow
column does not match the datatype of the method—in this
case, DateTime.
Computed fields displaying date or time values have a datatype
of DateTime, not date or time. Always use GetItemDateTime to
get their value, not GetItemDate or GetItemTime.
Examples
These statements set as_of to the current
DateTime data in the primary buffer for row 3 of the column named
start_dt in the DataWindow dw_emp:
|
1 |
DateTime as_of |
|
1 |
as_of = dw_emp.<span>GetItemDateTime</span>(3, "start_dt") |
These statements set as_of to the current
DateTime data in the delete buffer for row 3 of the end_dt
column of dw_emp:
|
1 |
DateTime as_of |
|
1 |
as_of = dw_emp.<span>GetItemDateTime</span>(3, "end_dt", & |
|
1 |
Delete!, false) |
These statements set AsOf to the original DateTime
data in the primary buffer for row 3 of the end_dt column
of dw_emp:
|
1 |
DateTime as_of |
|
1 |
as_of = dw_emp.<span>GetItemDateTime</span>(3, "end_dt", & |
|
1 |
Primary!, true) |