Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date problem
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Title:
Miscellaneous
Thread ID:
00469814
Message ID:
00469890
Views:
23
>>>>Works fine, but it will give you problems with ambiguous dates if SET STRICTDATE is not 0.
>>>
>>>Um, this is 2.x so strict date is a problem but other date formats could be.
>>
>>Whoops, missed the 2.6 part. Still would cause you a problem if you brought the code up to VFP, though.
>>
>>So...you'd
lcdateset = SET('DATE')
>>>SET DATE MDY
>>>* Convert strings to dates
>>>SET DATE (lcdateset)
>>
>>I still think that DTOS() would be better and that was in 2.6, too. ;)
>
>I mentioned it in my initial reply, but DTOC(< date >, 1) does exactly the same thing. The problem that I saw was the mention of the date fields being stored as strings. If they're ever coverted to dates, then the above is a workaround. The question is "Where's the most overhead"? Not knowing the format of the character fields is what has to be looked at. If they're in YYYYMMDD format, then it's most efficient to convert the one date you're examining. However, if they're stored as MM/DD/YYYY, then changing the SET DATE setting is probably going to work best. Haven't tested it though.

Dates stored as characters will always be problematic (especially if there's only 2 digits for the year). I had forgot that DTOC(date,1) was available in 2.6, too.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform