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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table restructure

Status
Not open for further replies.

JustMe12345

Programmer
Mar 24, 2000
8
US
I've 'inherited' a Paradox database.&nbsp;&nbsp;A field, HireDate, has been defined as Alphanumeric.&nbsp;&nbsp;How can I change this to Numeric so we can perform calculations on it?<br><br>For example: I want to list all employees hired within the last 90 days, so I'd query on '&lt; TODAY-90'.<br><br>Thanks
 
I figured out how to change the type of field, but the data has / marks that I need to get rid of.&nbsp;&nbsp;Any suggestions on how to do a mass change in the data?<br><br>Thanks!
 
&nbsp;&nbsp;Here's what I would do for your mass change of data:<br>1) backup your table with table copy under tools<br>2) restructure table with a new field: HireDate2 and make it a date field<br>3) scan table and convert alpha to date<br><br>like this:<br><br>tc1.open(&quot;employee.db&quot;)<br><br>scan tc1:<br>&nbsp;&nbsp;&nbsp;tc1.hiredate2 = date(tc1.HireDate)<br>endscan<br><br><br>4) now restructure the table, delete hiredate, and rename hiredate2 to hiredate<br>5) now that your hiredate is a date field you can preform calculations on it.<br><br><br>hope that helps.<br><br>Brian Moreland<br><A HREF="mailto:brian_moreland@hotmail.com">brian_moreland@hotmail.com</A>
 
&nbsp;&nbsp;Here's what I would do for your mass change of data:<br>1) backup your table with table copy under tools<br>2) restructure table with a new field: HireDate2 and make it a date field<br>3) scan table and convert alpha to date<br><br>like this:<br><br>tc1.open(&quot;employee.db&quot;)<br><br>scan tc1:<br>&nbsp;&nbsp;&nbsp;tc1.hiredate2 = date(tc1.HireDate)<br>endscan<br><br><br>4) now restructure the table, delete hiredate, and rename hiredate2 to hiredate<br>5) now that your hiredate is a date field you can preform calculations on it.<br><br><br>hope that helps.<br><br>Brian Moreland<br><A HREF="mailto:brian_moreland@hotmail.com">brian_moreland@hotmail.com</A>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top