Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create a STOD command/function?
Message
From
01/05/2002 11:58:26
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Title:
How to create a STOD command/function?
Miscellaneous
Thread ID:
00651378
Message ID:
00651378
Views:
83
Hi all,

I have a character field that is a date in mmddyyyy format. I need to sort the file by this serv_date field.

There is a DTOS (Date To String) command, but no inverse STOD (String To Date). Currently I am using:
*)******************************************************************************
*) we change serv_date from looking like 
*) "06251998" to look like "06/25/1998"
*)------------------------------------------------------------------------------
m.serv_date = SUBSTR(serv_date,1,2) + "/" + SUBSTR(serv_date,3,2) + ;
"/" + SUBSTR(serv_date,5,4)
Then I use CTOD(m.serv_date). Since the table is over 5.5Meg records, this takes a while using a SEEK inside of a scan. What is frequently requested is that I create a new table based on serv_date from a particular date to a particular date. Then create a "KILL" table with serv_date between the last particular date till DATE(). The table crosses the Y2K boundary, so that is also a challenge, especially in FPW2.6. I have thought about changing the field to a date format, but that would mean changing numerous programs across several projects. If there's no other way, then that's the way I'll go.

Does anybody know of a faster/better way to do this? Maybe something in SQL? I'm not smart enough to figure it out.
Help!!

TIA
Pete
Peter Adams
FoxPro Programmer
Compu-Mail

Heisenberg was probably right...
Next
Reply
Map
View

Click here to load this message in the networking platform