ldDate = {01/01/0204} ? TRANSFORM(ldDate) && Ok SET DATE LONG ? TRANSFORM(ldDate) && Error * Temporary change date format and restore after date conversion lcSaveDateFormat = SET("Date") SET DATE AMERICAN ? TRANSFORM(ldDate) SET DATE (lcSaveDateFormat)>From Insert and Update triggers the following code is run from a stored procedure in the DBC. Part of our process was collecting information from other Databases and either updating or inserting records based on certain criteria. During this process we were getting error 2034 "Date/Datetime evaluted to an invalid value". This would occur when the information we were receiving had funky date values (example would be 01/01/0204 rather than 01/01/2004). Since i have no control over checking validity of dates, we are simply updating new DBC with these values.
>cNewChanges='' > >For lnField = 1 To Fcount(LCTABLE) > > If Transform(Oldval(Field(lnField,LCTABLE))) != Transform(Evaluate(Field(lnField,LCTABLE))) > > cNewChanges = cNewChanges +'<fld>'+FIELD(lnField)+'</fld>'+CHR(13)+; > '<typ>'+TYPE('EVALUATE(FIELD(lnField))')+'</typ>'+CHR(13)+; > '<old>'+Transform(Oldval(Field(lnField,LCTABLE)))+'</old>'+CHR(13)+; > '<new>'+Transform(Evaluate(Field(lnField,LCTABLE)))+'</new>'+Chr(13) > ENDIF > >Endfor > >>