SQL Server and DateTime-Fields
Posted: Tue 21 May 2013 19:23
Hi
I have SQL Server 2012 (and D XE2) and a table with DateTime-Fields. If I access this field I get the following results:
in ManagementStudio the SQL SELECT CAST(myDate AS INT) returns0 (as expected)
in ManagementStudio the SQL SELECT myDate returns 1900-01-01 00:00:00.000
in Delphi with a TMsTable myTable.FieldByName('myDate').AsDateTime Returns 2 (why??)
I redevelop an old BDE-application, and in BDE "AsDateTime" was 0 and "AsString" 31.12.1899
Can you please give me some explanations why I get other values? Thanks, Peter
I have SQL Server 2012 (and D XE2) and a table with DateTime-Fields. If I access this field I get the following results:
in ManagementStudio the SQL SELECT CAST(myDate AS INT) returns0 (as expected)
in ManagementStudio the SQL SELECT myDate returns 1900-01-01 00:00:00.000
in Delphi with a TMsTable myTable.FieldByName('myDate').AsDateTime Returns 2 (why??)
I redevelop an old BDE-application, and in BDE "AsDateTime" was 0 and "AsString" 31.12.1899
Can you please give me some explanations why I get other values? Thanks, Peter