csv dates

Post Reply
sourceuno
Posts: 225
Joined: Mon Apr 09, 2001 3:58 pm

csv dates

Post by sourceuno »

I'm creating a csv file using Vortex to write to an output file. When I look at the output file, I see "Out of range" in one of the date fields. How can I avoid this and make this field blank so that a TIMPORT would be able to read this file.

Here's my code:

<WRITE "l:\exptech.txt">
<SQL ROW "select * from tech">
<sandr "|" "" $Title>
<$newTitle=$ret>
<sandr "|" "" $Body>
<$newBody=$ret>
<fmt "%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s\n"
$id $forumid $ThreadID $SiteURL $Visited $Dlsecs $Url
$newTitle $newBody $LastPost $Replies $yearrangebegin $yearrangeend
$SiteType $Active $Metadata>
</sql>
</WRITE>
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

csv dates

Post by John »

You could convert that field to a string first, and make the decision. Not sure which variable it is, but you could say:

<strfmt %s $var>
<if $ret eq 'Out of range'>
<$dvar=''>
<else>
<$dvar=$var>
</if>
<fmt "....|%s|...." $dvar>
John Turnbull
Thunderstone Software
sourceuno
Posts: 225
Joined: Mon Apr 09, 2001 3:58 pm

csv dates

Post by sourceuno »

Would you happen to know what would cause a date field to be out of range? I know these dates are valid in the table.
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

csv dates

Post by John »

It should show the same if you select from the table with tsql. It would indicate a date outside the range of 1970-2038.
John Turnbull
Thunderstone Software
Post Reply