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