k,
a little more help on conveting it to a date type. My formula is
whileprintingrecords;
Stringvar MyDt:={MyTable.Field}";
stringvar MyStrDate:=trim(mid(MyDt, instrrev(MyDt," ")));
cdate(MyStrDate)
Sounds like the date isn't consistent in the field.
Try:
a little more help on conveting it to a date type. My formula is
whileprintingrecords;
Stringvar MyDt:={MyTable.Field}";
stringvar MyStrDate:=trim(mid(MyDt, instrrev(MyDt," ")));
if isdate(MyStrDate) then
cdate(MyStrDate)
else
cdate(1970,1,1)
Take a look at what is in the field for the ones that are returned as 1/1/1970 by placing your field alongside in the details.
Looks like the date conversion formula is always failing the IsDate test. The first date displayed is the first formula you gave my which does extract the date as a string. the second date is the formula to convert to date and the third is the acutal field entry.
i.e
String Formula Date Formula Actual Field
1/10/2006 1/1/1970 Integrated - 1/10/2006
Any thoughts
I justed tested SV's formula and it works. I wonder if your memo field really has the space before the 01. In your original post, it looked like the hyphen was immediately followed by the 01, in which case the formula would extract -01/10/06 and would fail. If there is always a hyphen, you could try:
whileprintingrecords;
numbervar fldlen:= len(trim({table.field}));+1
Stringvar Output:="";
for x:= 1 to len({table.field} do(
if isnumeric(mid({table.field},fldlen-x,1))
or
mid({table.field},fldlen-x,1)) = "/" then
Output := Output+mid({table.field},fldlen-x,1))
);
Output
This assumes that there are no other numerics or slashes (/) in the field. If there are, then you'll need to stop the output fill in an else clause.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.