Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date type
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01644735
Message ID:
01644766
Views:
43
>>I am just about completing a fairly extensive import utility of CSV files, and have a potential concern about this type of date found as a character (I was thinking there was a built in VFP way to make this conversion, but can't remember what it was) :
>>
>>December 12, 2016 or Dec. 12, 2016
>>
>>If I allow a user to select the above as a Date field, I need to convert it to a normal 12/12/2016 which is stored as a date field in the table. Anyone know the best way to do this? I will not know ahead how the date is stored and will be testing it before appending it to the actual date field in the table.
>
>FoxPro would not recognize it as a date. You will have to roll out your own conversion
>Something like (pseudo code)
>

>lnItems = ALINES(laItems, lcDate, [,])
>
>IF lnItems = 3
> AND laItems[1] LIKE < One of Month >
> AND VAL(laItems[2]) BETWEEN 1 and 31
> AND VAL(laItems[3]) BETWEEN 2000 AND 2099
> *It maybe a date
>ELSE
> * bummer
>END
>
>


Thanks Sergey.
Previous
Reply
Map
View

Click here to load this message in the networking platform