GetItemDate method (DataWindows)
Description
Gets data whose type is Date 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.

component
Separate method names, GetItemDateByColNum, GetItemDateByColNumEx,
and GetItemDateEx, 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 |
Web ActiveX |
DataWindow control, DataWindowChild object |
Syntax
[PowerBuilder]
1 |
date <span>dwcontrol</span>.<span>GetItemDate</span> ( long <span>row</span>, string <span>column</span> <br> {, DWBuffer <span>dwbuffer</span> , boolean <span>originalvalue</span> } )<br>date <span>dwcontrol</span>.<span>GetItemDate</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>GetItemDate</span> ( long <span>row</span>, string <span>column</span>)<br>string <span>dwcontrol</span>.<span>GetItemDateByColNum</span> ( long <span>row</span>, short <span>column</span> )<br>string <span>dwcontrol</span>.<span>GetItemDateByColNumEx</span> ( long <span>row</span>, short <span>column</span>, <br> string <span>dwbuffer</span>, boolean <span>originalvalue</span> )<br>string <span>dwcontrol</span>.<span>GetItemDateEx</span> ( long <span>row</span>, string <span>column</span>, <br> string <span>dwbuffer</span>, boolean <span>originalvalue</span> ) |
[Web ActiveX]
1 |
Date <span>dwcontrol</span>.<span>GetItemDate</span> ( number <span>row</span>, string <span>column</span>, <br> number <span>dwbuffer</span>, boolean <span>originalvalue</span> )<br>Date <span>dwcontrol</span>.<span>GetItemDate</span> ( number <span>row</span>, number <span>column</span>, <br> number <span>dwbuffer</span>, boolean <span>originalvalue</span> ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to a 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 specify dwbuffer, you must also |
Return Values
Returns the date 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
if any other error occurs.
If any argument value is null, in PowerBuilder and JavaScript
the method returns null.
Usage
Use GetItemDate 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.
An execution error occurs when the datatype of the DataWindow
column does not match the datatype of the method; in this case,
date.

There is a difference in datatypes between columns and computed columns
retrieved from the database and computed fields defined in the DataWindow
painter. Computed columns from the database can have a datatype
of date, but a date computed field always has a datatype of DateTime,
not date. In PowerBuilder, use the GetItemDateTime method instead.

Use GetItemDate for all columns of type
date, DateTime, and time.

When you call GetItemDate as an argument
for the String function and do not specify a
display format, the value is formatted as a DateTime value. This
statement returns a string like “2/26/96 00:00:00”:
1 |
String(dw_1.GetItemDate(1, "start_date")) |
To get a simple date string, you can specify a display format:
1 |
String(dw_1.GetItemDate(1,"start_date"), "m/d/yy") |
or you can assign the date to a date variable before calling
the String function:
1 |
date ld_date |
1 |
string ls_date |
1 |
ld_date = dw_1.GetItemDate(1, "start_date") |
1 |
ls_date = String(ld_date) |
Examples
These statements set hiredate to the current Date
data in the third row of the primary buffer in the column named
first_day of dw_employee:
1 |
Date hiredate |
1 |
hiredate = dw_employee.<span>GetItemDate</span>(3, "first_day") |
These statements set hiredate to the current Date
data in the third row of the filter buffer in the column named first_day
of dw_employee:
1 |
Date hiredate |
1 |
hiredate = dw_employee.<span>GetItemDate</span>(3, & |
1 |
"first_day", Filter!, false) |
These statements set hiredate to original Date data
in the third row of the primary buffer in the column named hdate
of dw_employee:
1 |
Date hiredate |
1 |
hiredate = dw_employee.<span>GetItemDate</span>(3, & |
1 |
"hdate", Primary!, true) |