Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting dates to have the century
Message
From
16/05/2006 12:14:09
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01122317
Message ID:
01122326
Views:
15
>I have a .dbf free table that has dates as 01/01/06. This seems to be causing a "database engine failue" when I use this dbf as my data source in a Word Mail Merge. (I selected dbase files). I know the fix is to SET CENTURY ON in the code before creating the .dbf. But how do I converted my 01/01/06 to 01/01/2006 in my existing .dbf?
>
>Brenda

Try converting the date field to a character and back with SET CENTURY ON

Something like this:
SET CENTURY ON

UPDATE <table>
   SET <datefield> = CTOD(DTOC(<datefield>))
Wine is sunlight, held together by water - Galileo Galilei
Un jour sans vin est comme un jour sans soleil - Louis Pasteur
Water separates the people of the world; wine unites them - anonymous
Wine is the most civilized thing in the world - Ernest Hemingway
Wine makes daily living easier, less hurried, with fewer tensions and more tolerance - Benjamin Franklin
Previous
Reply
Map
View

Click here to load this message in the networking platform