Can someone help me with displaying a date in a listview? I have a serial number date and I can't figure out how to display it as a date (m/d/cy) in the grid unless I pre-convert it to a regular date first in which case it won't sort correctly in the grid.
I hunted through the wiki and can't anything, though the grid & list page links to release notes of 04/16/06 which say it discusses the "new date format" (it doesn't). I tried to find a date example from our homework in Gabriel's conference classes, to no avail.
I just need to know what the grid spec/form in the HEADER statement should be for the date column if I start with a serial # date.
Thanks
-- Susan
Listviews - Date format
Moderators: Susan Smith, admin, Gabriel
-
- Posts: 717
- Joined: Sun Aug 10, 2008 4:24 am
- Location: Southern California
-
- Posts: 717
- Joined: Sun Aug 10, 2008 4:24 am
- Location: Southern California
I remember something about being able to use DATE(MM/DD/CCYY) as the format and also using a Character Field.
My Character field is formated as MM/DD/CCYY
My goal is to be able to pass Character fields to a Grid, and have the sort as date fields.
Does anyone know the syntax for this? (Also the BR version that implemented it).
My Character field is formated as MM/DD/CCYY
My goal is to be able to pass Character fields to a Grid, and have the sort as date fields.
Does anyone know the syntax for this? (Also the BR version that implemented it).
From 4.1 release notes-
********** A new FIELDS format is supported: **********
row,col,DATE(dd/mm/yy)
- The values are displayed as dates but are stored internally
as day of century.
- The mask may be any valid DATE() mask.
Numeric Column Sorting
2D controls now facilitate numeric column sorting. This works well in
conjunction with the new DATE field format (see release notes 04/06/06)
where the data is stored as day of century, but is displayed as a
formatted date. It also works with all numeric columns.
The 4.1 release notes should also have said:
The user and the program works with the full date format while BR converts it to and from day of century for internal sorting purposes.
----------------------------------------------------
The 4.2 release notes say-
In GRIDs and LISTs only, string arrays may be used to process numeric values. BR automatically performs VAL and STR conversions as needed. If string data is passed to a numeric field type such as N or DATE then it is automatically converted to numeric form for internal processing.
********** A new FIELDS format is supported: **********
row,col,DATE(dd/mm/yy)
- The values are displayed as dates but are stored internally
as day of century.
- The mask may be any valid DATE() mask.
Numeric Column Sorting
2D controls now facilitate numeric column sorting. This works well in
conjunction with the new DATE field format (see release notes 04/06/06)
where the data is stored as day of century, but is displayed as a
formatted date. It also works with all numeric columns.
The 4.1 release notes should also have said:
The user and the program works with the full date format while BR converts it to and from day of century for internal sorting purposes.
----------------------------------------------------
The 4.2 release notes say-
In GRIDs and LISTs only, string arrays may be used to process numeric values. BR automatically performs VAL and STR conversions as needed. If string data is passed to a numeric field type such as N or DATE then it is automatically converted to numeric form for internal processing.
I figured out my problem.
In the Grid Spec, I need to use DATE(m/d/cyy)
In the Character Field, I need to pass the 'DAYS' or Julian Value.
My string contained a "Formatted Date" "MM/CC/CCYY".
I don't suppose there is a format that will accept a "Formatted Date", but still treat the column as a Date?
In the Grid Spec, I need to use DATE(m/d/cyy)
In the Character Field, I need to pass the 'DAYS' or Julian Value.
My string contained a "Formatted Date" "MM/CC/CCYY".
I don't suppose there is a format that will accept a "Formatted Date", but still treat the column as a Date?
Upon further investigation, I have learned that the DATE format only works with internal storage of day of century. So my above quote is incorrect. I should have said:The user and the program works with the full date format while BR converts it to and from day of century for internal sorting purposes.
The program works with day of century, while the user works with the full date format.