Formatting problem

  • Thread starter Thread starter Nathan
  • Start date Start date
N

Nathan

I'm attempting to convert a string into a format that can be converted into
a date but VB.Net isn't giving me the same result as VB6.

The string I need to convert, and I have no influence over the it, is a date
but stored with out any seperators or spaces e.g. 20040306

In VB6 I can alter this to 2004 03 06 using the command: FORMAT(sData,"####
## ##")

But when I try this in VB.Net all I get is #### ## ##.

I've read the help and it seems to suggest that what I'm trying to do should
work. What am I missing?

Nathan
 
Nathan

Tr
Format(CLng(sData), "#### ## ##"

Chris

----- Nathan wrote: ----

I'm attempting to convert a string into a format that can be converted int
a date but VB.Net isn't giving me the same result as VB6

The string I need to convert, and I have no influence over the it, is a dat
but stored with out any seperators or spaces e.g. 2004030

In VB6 I can alter this to 2004 03 06 using the command: FORMAT(sData,"###
## ##"

But when I try this in VB.Net all I get is #### ## ##

I've read the help and it seems to suggest that what I'm trying to do shoul
work. What am I missing

Natha
 
Back
Top