Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Desk top & the pwFormatDate formula

Status
Not open for further replies.

Quigs

Technical User
Jun 25, 2000
3
NZ
All the dates in the accounting package I am working with are numbers (20000703) So I use the pwFormatDate formula to convert them to a more presentable format. From the designer the reports run fine, but when I try to run the reports from Info Desktop this formula wont process. What am I doing wrong?
 
Since your date field is in number, if you convert it totext(table.datefield), it will be displayed as &quot;20,000,703.00&quot;, making the length = 13<br><br>convert this # to string, parse it up to store the year (will require two variables to exclude comma), month (again, will require two variables) and day.&nbsp;&nbsp;Then concatenate the string and display on the report.<br><br>e.g. <br><br>//converts database field to text<br>stringvar dt1; <br><br>//stores year<br>stringvar yr1;<br>stringvar yr2;<br><br>//stores month<br>stringvar mnt1;<br>stringvar mnt2;<br><br>//stores day<br>stringvar dy;<br><br>//final display date after concatenation<br>stringvar dsplydte;<br><br>dt1 := totext({table.column});<br><br>yr1 := left(dt1, 2);<br>yr2 := mid(dt1, 4,2) ;<br>mnt1 := mid(dt1, 6,1);<br>mnt2 := mid(dt1, 8,1)&nbsp;&nbsp;;<br>dy := mid(dt1, 9,2);<br><br>dte := yr1 + yr2 + &quot;/&quot; + mnt1 + mnt2 + &quot;/&quot; + dy ;<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top