Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting ctod()
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00186943
Message ID:
00186949
Vues:
10
>I have a field that was previously not being used as a real date field but now needs to be a type date. When we changed the data type of the field, type() returns D but it doesn't order like a date and SQL querys on that field are unpredictable for the records that were originally entered as type C. Any way to fix the old records to be a real date?

Easiest would be a SQL Select that extracted the CTOD() of the field with the same name to a temporary table or SDF text file (if you extract to a text file, save the DTOS(CTOD()) of the field being changed), alter the structure using ALTER TABLE or MODIFY STRUCTURE or whatever, delete the old data and append in the temporary copy.

You might do better creating a new table appending and renaming rather than the DELTE/APPEND routine - brave souls who don't often are paid a visit by Mr. Murphy. if you COPY STRUCUTRE WITH PRODUCTION to the temporary table, change its structure, and then append, you gain the benefit of having the old data intact and getting your structural CDX rebuilt with no bloat; it also can clean up your memo files at the same time, and you can decide not to copy over deleted records, too.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform