RDATE is the answer, it takes there intregers M,D,YYYY

RDATE(INT(SGET(CTXT(StartDate),2,5))),INT(SGET(CTXT(StartDate),2,7))),INT(SGET(CTXT(StartDate),4,1))))

Dennis McGrath

________________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of 
[email protected]
Sent: Tuesday, April 21, 2009 8:57 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Numeric date type

I am importing a table from an external database.
It has dates recorded in numeric type columns such as 20090420
 
After importing the table I have added a column MO_Start data type of date.
I want to update the values in this column to the date in the numeric field 
StartDate.
I tried....
 
Update TempMO set MO_Start = +
( (SGET((CTXT(StartDate)),2,5)) + '/' + +
  (SGET((CTXT(StartDate)),2,7)) + '/' + +
  (SGET((CTXT(StartDate)),4,1)) )

This returns "Expression does not return a valid date"
 
One can set a Date column type to a text variable, I.E.
 
set var vTxtDate Text = '04/20/2009'
 
Update TempMO set MO_Start = .vTxtDate 
 
This works without error.  
 
However, the UPDATE command does not like the 
expression evidently.
 
I need to update the TempMO table's MO_Start date to
the date listed in the numeric column.  (I have to do a lot of
calculations on the dates and it is MUCH easier if in a date format)
 
Any thoughts on an UPDATE command to accomplish this?
 
Thanks,
-Bob
 


Reply via email to