Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use table command
Message
From
05/12/2001 08:00:48
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
05/12/2001 07:51:10
John Marrone
Bloodstock Research Inc.
Lexington, Kentucky, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00589715
Message ID:
00589731
Views:
20
>Thanks for the help Cetin. Can you help me with this.
>
> REPLACE rac.DDate WITH SUBSTR(aAr(2),5,2) + '/' + SUBSTR(aAr(2),7,2) + '/' + SUBSTR(aAr(2),3,2)
>
>DDate is a date field. aAr(2) holds the value "20011113". when I issue this
>command I get a type mismatch. After I send you this am going to research if
>foxpro has some kind of type conversion function. Thanks again.

REPLACE rac.DDate WITH ;
ctod(SUBSTR(aAr(2),5,2) + '/' + SUBSTR(aAr(2),7,2) + '/' + SUBSTR(aAr(2),3,2))

However above is not only cumbersome but 'set date' dependant (under different settings would produce unexpected results). Safer :
REPLACE rac.DDate WITH ctod( transform(aArr(2), '@R ^9999/99/99') )
For date conversions check Ctod(), dtoc(), date(), ctot(), cmonth() ...
For time conversions check ttod(), ttoc(), ctot() ...
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform