ADO date returns odd values

I have a simple table for testing defined as follows

/****** Object:  Table [dbo].[Table_1]    Script Date: 6/13/2019 3:43:28 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Table_1](
	[datecol] [date] NULL,
	[column_1] [nchar](10) NULL,
	[moneyCol] [money] NULL
) ON [PRIMARY]
GO

Can connect insert & query data
But one column comes out really strange using ADO on Windows 10 (doesnt matter if I use 32 bit or 64 bit here as I get odd values either way)

Case ADODB.DataType.adDBDate    // 133    A date value (yyyymmdd).
  Dim v As String = mOLEObject.Value
  Dim vi64 As Int64 = mOLEObject.Value
  Return v

the string has “3.46420801e+9” and the int64 has 3464208001
I’m actually expecting something more like 2013-10-10 which I can see in MS SQL Server Management Studio
Any ideas on what I’m doing wrong ?

looks like totalseconds to me

Dim d As New date
d.totalseconds=3464208001
MsgBox d.SQLDatetime

perhaps you should query a property other than “value”?

Value is the right one since there IS no other one of use on an ADO Field object
Just interesting that no references say that the date is a total seconds (they say something for other return types but not this one)

This should work :slight_smile:
Thanks for thinking of that

Hey, you have bailed me out a few time in the past, glad I could finally do one for you …LOL