"rodchar" <(E-Mail Removed)> wrote in message
news:C5B58584-D892-4D88-A3FB-(E-Mail Removed)...
> i have a number field i need to convert
> from
> 20050818
> to
> 08182005
Without resorting to nasty Modular mathematics :
i = 20050818
s = i.ToString()
s = s.SubString( 4, 4 ) & s.SubString( 0, 4 )
i = CInt( s ) ' or Convert.ToInt32( s ), whichever you prefer.
Neither of which, of course, are dates - to get those, you'd need :
s = i.ToString()
s = s.SubString( 0, 4 ) _
& "-" & s.SubString( 4, 2 ) _
& "-" & s.SubString( 6, 2 )
d = CDate( s )
HTH,
Phill W.
|