Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SHORT dates don't work with CTOD()?

Status
Not open for further replies.

rkolva

Programmer
Jan 16, 2003
127
US
My app connects to a server on a daily basis to retrieve data updates and fill any requests for missing data. I'm using config.fpw as an ini file and storing the last date it connected as a string. Everything was working fine until they asked to switch to the following date format: 'DD-MON-YY' so today become '09-JUN-05'. I changed my Window's Short date format and VFP to their request. Now I'm finding that every time the app starts it's retrieving data sets because CTOD('09-JUN-05') == { - - }?

I'm guessing that somebody overlooked converting this date format back to a date type in CTOD()? Or am I doing something wrong?

Thanks,

Ralph Kolva
 
I think, dates need to be numeric based, except perhaps in SQL statements...

CTOD('09/06/05')



Regards

Griff
Keep [Smile]ing
 
Thanks Griff,

that would seem to follow with what I've been experiencing. I suppose since I've never had a problem with CTOD() before and the help file doesn't mention anything about not working with SHORT threw me for a little bit of a loop. Now I'll need to figure out another method of checking. I don't want to parse the month back into a numeric as this app is used in several languages and that just seems like asking for trouble.

Thanks again

Ralph Kolva
 

There is no function in VFP converting '09-JUN-05' format to a date, but it's not hard to write your own.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top