Hi everybody,
I have a string like this : "290302" and I'd like to convert into
the format : "29:03:02" but I can't.
I tried this :
= Format(ds.FieldOra, "T") but it couldn't get the new format.
It displays always the same "290302".
Also I tried with = Format(ds.Field1, "hh:mm:ss")
but all remains the same.
Could you help me ?
Thanks in advance!
DomenicoDomenico,
You can't do that because dates aren't stored as strings internaly. They
are numbers.
You could use the regular string manipualtion functions to get the result
you want.
=Left(ds.Field1,2) & ":" & Mid(dsField1, 3,2) & ":" & Right(ds.Field1, 2)
should just about do it for you.
Regards,
Rob Labbé, MCP, MCAD, MCSD, MCT
Lead Architect/Trainer
Fidelis
Blog: http://spaces.msn.com/members/roblabbe
"Riddick" <Riddick@.discussions.microsoft.com> wrote in message
news:CF69816F-BEEA-497F-80B0-FE59BA0A1688@.microsoft.com...
> Hi everybody,
> I have a string like this : "290302" and I'd like to convert into
> the format : "29:03:02" but I can't.
> I tried this :
> = Format(ds.FieldOra, "T") but it couldn't get the new format.
> It displays always the same "290302".
> Also I tried with = Format(ds.Field1, "hh:mm:ss")
> but all remains the same.
> Could you help me ?
> Thanks in advance!
> Domenico|||Thank you Rob :)
"Rob Labbe (Lowney)" wrote:
> Domenico,
> You can't do that because dates aren't stored as strings internaly. They
> are numbers.
> You could use the regular string manipualtion functions to get the result
> you want.
> =Left(ds.Field1,2) & ":" & Mid(dsField1, 3,2) & ":" & Right(ds.Field1, 2)
> should just about do it for you.
> Regards,
>
> --
> Rob Labbé, MCP, MCAD, MCSD, MCT
> Lead Architect/Trainer
> Fidelis
> Blog: http://spaces.msn.com/members/roblabbe
> "Riddick" <Riddick@.discussions.microsoft.com> wrote in message
> news:CF69816F-BEEA-497F-80B0-FE59BA0A1688@.microsoft.com...
> > Hi everybody,
> >
> > I have a string like this : "290302" and I'd like to convert into
> > the format : "29:03:02" but I can't.
> >
> > I tried this :
> > = Format(ds.FieldOra, "T") but it couldn't get the new format.
> > It displays always the same "290302".
> >
> > Also I tried with = Format(ds.Field1, "hh:mm:ss")
> > but all remains the same.
> >
> > Could you help me ?
> > Thanks in advance!
> >
> > Domenico
>
>