Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

SaveAs Excel where column type is date

2 posts in DataWindow Last posting was on 2008-04-04 15:54:41.0Z
Carol Burrows Posted on 2008-04-02 15:12:57.0Z
Reply-To: "Carol Burrows" <carolb@dbcsmartsoftware.com>
From: "Carol Burrows" <carolb@dbcsmartsoftware.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: SaveAs Excel where column type is date
Lines: 17
Organization: DBC SMARTSoftware
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47f3a279$1@forums-1-dub>
Date: 2 Apr 2008 07:12:57 -0800
X-Trace: forums-1-dub 1207149177 10.22.241.152 (2 Apr 2008 07:12:57 -0800)
X-Original-Trace: 2 Apr 2008 07:12:57 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86590
Article PK: 415850

I'm running Powerbuilder 11.1 Build 8123.

If I use the SaveAs method on a datawindow that contains a date column, I am
unable to format the column in Excel as a date. It seems that the date
field is output as a character field in Excel rather than a date formatted
field. Even if I apply a date format to the cell once I'm in Excel it
doesn't apply the format unless I actually edit the cell and tab out of it.

Is this a Powerbuilder issue or is there something I'm doing wrong when I
export the datawindow as Excel!? Also, I have the format for the date
column set to [shortdate]. Does this matter? What format does Powerbuilder
choose for a date column when doing the SaveAs to Excel?

Thanks,
Carol


KL Posted on 2008-04-04 15:54:41.0Z
Sender: 45b3.47f29756.1804289383@sybase.com
From: KL
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: SaveAs Excel where column type is date
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <47f64f41.1ac1.1681692777@sybase.com>
References: <47f3a279$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 4 Apr 2008 07:54:41 -0800
X-Trace: forums-1-dub 1207324481 10.22.241.41 (4 Apr 2008 07:54:41 -0800)
X-Original-Trace: 4 Apr 2008 07:54:41 -0800, 10.22.241.41
Lines: 28
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86604
Article PK: 415864

Try:
xlsub = ole_excel.Application.ActiveWorkbook.Worksheets[1]
xlsub.Columns("A:A").Select // where "A:A" is the Excel
column
ole_excel.Selection.NumberFormat = "mm/dd/yyyy;@"

KL

> I'm running Powerbuilder 11.1 Build 8123.
>
> If I use the SaveAs method on a datawindow that contains a
> date column, I am unable to format the column in Excel as
> a date. It seems that the date field is output as a
> character field in Excel rather than a date formatted
> field. Even if I apply a date format to the cell once I'm
> in Excel it doesn't apply the format unless I actually
> edit the cell and tab out of it.
>
> Is this a Powerbuilder issue or is there something I'm
> doing wrong when I export the datawindow as Excel!? Also
> , I have the format for the date column set to
> [shortdate]. Does this matter? What format does
> Powerbuilder choose for a date column when doing the
> SaveAs to Excel?
>
> Thanks,
> Carol
>
>