Re: Fastest way to convert 1000's of YYYYMMDD char dates to real dates?
- From: "Lew" <lew@xxxxxxxxxxx>
- Date: Sun, 2 Dec 2007 20:33:14 -0500
Giancarlo's eval() solution is unexpectedly quick, although, given the fact
that dates are stored in tables in YYYYMMDD format, you'd think there'd be a
strictdate 0 builtin. Your append from text takes advantage of that.
"Anders Altberg" <anders.altberg> wrote in message
news:%23$QzksUNIHA.2000@xxxxxxxxxxxxxxxxxxxxxxx
If they are in in a column, put them into a textfile:
SELECT table
COPY TO dates.txt FIELDS id, date DELIMITED
then:
CREATE CURSOR Dates (id int , d1 date)
SET DATE YMD
APPEND FROM dates.txt DELIMITED
or, using some VFP functions:
x = "20070812"
? DATE(VAL(LEFT(x,4)),VAL(SUBSTR(x,3,2)),VAL(RIGHT(x,2)))
-Anders
"Giancarlo Piccinato" <piccinato@xxxxxxxxxxx> wrote in message
news:u79etzTNIHA.5988@xxxxxxxxxxxxxxxxxxxxxxx
Try this:
eval("{^"+tran("20071202","@R 9999/99/99")+"}")
Giancarlo
"Lew" <lew@xxxxxxxxxxx> wrote in message
news:Oefm0WTNIHA.2308@xxxxxxxxxxxxxxxxxxxxxxx
--
-Lew
The workers took the robot for Maria.
.
- Follow-Ups:
- Re: Fastest way to convert 1000's of YYYYMMDD char dates to real dates?
- From: Anders Altberg
- Re: Fastest way to convert 1000's of YYYYMMDD char dates to real dates?
- From: Krister
- Re: Fastest way to convert 1000's of YYYYMMDD char dates to real dates?
- References:
- Fastest way to convert 1000's of YYYYMMDD char dates to real dates?
- From: Lew
- Re: Fastest way to convert 1000's of YYYYMMDD char dates to real dates?
- From: Giancarlo Piccinato
- Re: Fastest way to convert 1000's of YYYYMMDD char dates to real dates?
- From: Anders Altberg
- Fastest way to convert 1000's of YYYYMMDD char dates to real dates?
- Prev by Date: Re: Fastest way to convert 1000's of YYYYMMDD char dates to real dates?
- Next by Date: Pure sql solution to date period
- Previous by thread: Re: Fastest way to convert 1000's of YYYYMMDD char dates to real dates?
- Next by thread: Re: Fastest way to convert 1000's of YYYYMMDD char dates to real dates?
- Index(es):
Relevant Pages
|