I haven't tried the excel route. I'll try it but I'm not familiar with most
of it but it is what I'm heading toward.

Gary Jeurink

-----Original Message-----
From: Alan Bourke [mailto:[email protected]] 
Sent: Wednesday, October 30, 2013 4:44 AM
To: [email protected]
Subject: Re: exporting to text delimited



On Wed, Oct 30, 2013, at 03:34 AM, Dan Covill wrote:
> On 10/29/13 07:31 PM, Gary Jeurink wrote:
> > COPY TO c:\alldat2\special\tmppfbstats.txt FOR pfbstats2.year=2013
> >
> >    FIELDS Pfbstats2.tmid, Pfbstats2.year, ...
> 
> use  FIELDS Pfbstats2.tmid, str(Pfbstats2.year,4) as Cyear, . etc
>     Then the DELIMITED will put quotes around it.

That 'as' syntax works for SQL Select, it doesn't work for COPY TO.

I would:

set textmerge on noshow
set textmerge to myfile.csv
select pbfstats2

* -- Headings row first.
\ tmid,year,yesno,mydate

* -- Then all the row data.
scan
    lcFormattedDate = Alltrim(Str(Year(mydate))) + "-" ;
              + Padl(Alltrim(Str(Month(mydate))), 2, "0") ;
               + "-" + Padl(Alltrim(Str(Day(mydate))), 2, "0")

    \ "<<field1>>","<<alltrim(str(year))>>","<<iif(yesno,'Y',
    'N')>>","<<lcFormattedDate>>"

Endscan

set textmerge off
set textmerge to





_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/58792E3930D04D4A8DB675A3FE7E9177@OwnerPC
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to