Herfried,
| I am curious why you are storing a /date/ as an integer. This is very
| uncommon.
Its common to store a "date" as an "integer" on AS/400 databases & other
databases.
At least at the shops that have code pre-dating "date" fields being added to
their database systems.
I normally seen the dates stored as Decimal(9, 0) or Packed(9,0) rather then
an Integer (32-bit binary value).
--
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uQ**************@TK2MSFTNGP14.phx.gbl...
| "Mika M" <ma***************@luukku.com> schrieb:
| > Is there better way to convert integer type date into DateTime type date
| > as doing like code below?
| >
| > Dim intDate As Integer = 20051019
|
| I am curious why you are storing a /date/ as an integer. This is very
| uncommon.
|
| > Dim dte As DateTime = New DateTime( _
| > CType(intDate.ToString.Substring(0, 4), Integer), _
| > CType(intDate.ToString.Substring(4, 2), Integer), _
| > CType(intDate.ToString.Substring(6, 2), Integer))
|
| \\\
| Dim dt As Date = Date.ParseExact(CStr(intDate), "yyyyMMdd", Nothing)
| ///
|
| --
| M S Herfried K. Wagner
| M V P <URL:http://dotnet.mvps.org/>
| V B <URL:http://classicvb.org/petition/>
|