Pdox 5 problem with Date Format 
Author Message
 Pdox 5 problem with Date Format

I am trying to copy records from table 1 to table 2, change all date fields
in table 2 to strings and export table 2 to a spreadsheet, all with code.
All goes well except that the dates will not retain a format of mm/dd/yyyy
when going from table 1 to table 2.

I can create a date format at the table level of table 1 to display
mm/dd/yyyy but when I copy the records to a table 2  via OPal, the data is
displayed as mm/dd/yy unless, of course, the year is 20xx.  
Table 1 has "date" defined fields, table 2 has "alpha" defined fields.

I am using Pdox5 with the BDE update and W95 and I have changed my setting
in idapi config to fourdigityear=TRUE.

I sure hope that someone can tell me what I am doing wrong with this
procedure and point me in the right direction.

Thanks
Susie



Fri, 08 Oct 1999 03:00:00 GMT
 Pdox 5 problem with Date Format

Quote:
> I am trying to copy records from table 1 to table 2, change all date
> fields in table 2 to strings and export table 2 to a spreadsheet, all
> with code. All goes well except that the dates will not retain a format
> of mm/dd/yyyy when going from table 1 to table 2.

Export as follows:

tcTable1.copyToArray(CurRec)
CurRec[x] = string(CurRec[x])
CurRec[y] = string(CurRec[y])
tcTable2.insertRecord()
tcTable2.copyFromArray(CurRec)

Daniel A. Morgan



Fri, 08 Oct 1999 03:00:00 GMT
 Pdox 5 problem with Date Format

Quote:

> I am trying to copy records from table 1 to table 2, change all date fields
> in table 2 to strings and export table 2 to a spreadsheet, all with code.
> All goes well except that the dates will not retain a format of mm/dd/yyyy
> when going from table 1 to table 2.

> I can create a date format at the table level of table 1 to display
> mm/dd/yyyy but when I copy the records to a table 2  via OPal, the data is
> displayed as mm/dd/yy unless, of course, the year is 20xx.
> Table 1 has "date" defined fields, table 2 has "alpha" defined fields.

> I am using Pdox5 with the BDE update and W95 and I have changed my setting
> in idapi config to fourdigityear=TRUE.

> I sure hope that someone can tell me what I am doing wrong with this
> procedure and point me in the right direction.

> Thanks
> Susie

The format for dates is set via the formatSetDateDefault() method
Check out the online help on this method

Hope this helps.
--
****************************************************

* SCF Consulting, Calgary, AB
*
* 'There are more objects in Mainframe and the Net
*  than are formulated in your paradigm, Bob'
****************************************************



Sat, 09 Oct 1999 03:00:00 GMT
 Pdox 5 problem with Date Format

Susie,

Several ways to do it, here's one:

1) Run a query on table 1 (All fields checked) that...
2) Saves the answer table to "Table2" and...
3) Uses a "Calc as" operator to create a new text field eg:
    Calc "1234567890" as Date2
4) Open Table2 as a TCursor
5) scan the TCursor and convert date1 to date2 via format statement
    tc scan:
      tc.date2  = format("W10,format("W10,DY3O(%M/%D/%Y)",tc.date1)
    endscan
6) Query Table2 but remove date1 check
7) Export answer table to spreadsheet

Good Luck

Steve



Quote:
> I am trying to copy records from table 1 to table 2, change all date
fields
> in table 2 to strings and export table 2 to a spreadsheet, all with code.
> All goes well except that the dates will not retain a format of
mm/dd/yyyy
> when going from table 1 to table 2.

> I can create a date format at the table level of table 1 to display
> mm/dd/yyyy but when I copy the records to a table 2  via OPal, the data
is
> displayed as mm/dd/yy unless, of course, the year is 20xx.  
> Table 1 has "date" defined fields, table 2 has "alpha" defined fields.

> I am using Pdox5 with the BDE update and W95 and I have changed my
setting
> in idapi config to fourdigityear=TRUE.

> I sure hope that someone can tell me what I am doing wrong with this
> procedure and point me in the right direction.

> Thanks
> Susie



Sun, 10 Oct 1999 03:00:00 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Default date Format - Pdox Win 5.0

2. PDOX DOS 4.5 - Date Export Format

3. Date Time format to Date format

4. Problem with converting date in String to sql date format for insertion

5. Date Format Problem/Internal Date Storage

6. Pdox 5 date locate problem

7. Dates Format: Trouble giulian format (long numeric value)

8. Date Formats in Tables (Wrong International Format)

9. Converting Unix Date/time format into SQL readable format

10. Formatting the date format without doing it in the cinnection string

11. Dates format Problem SQL 2000/Access XP


 
Powered by phpBB® Forum Software