Function AdoDateTimeAsDate()

This forum is the place to discuss issues related to ReportPro, Xs2Ado, Vo2Ado, bBrowser and other 3rd party products
Post Reply
User avatar
Kees Bouw
Posts: 119
Joined: Wed Nov 06, 2019 11:35 am
Location: Netherlands

Function AdoDateTimeAsDate()

Post by Kees Bouw »

It seems that the function AdoDateTimeAsDate() is not working as it is explained in the Xs2Ado Helpfile. There it says "When set to TRUE, all datetime values from ADO are returned as X# Dates.Time information is lost when using this conversion. When set to FALSE, all DateTime values from Jet are returned as AdoDateTime objects".

What I find is that when AdoDateTimeAsDate() is FALSE, the return type is Xs2Ado.AdoDateTime which is correct, but when it is TRUE, the return type is System.DateTime and not the X# DATE type as promised.

To have a workaround, what is the easiest way to convert from System.DateTime to DATE ?

Kees.
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Function AdoDateTimeAsDate()

Post by robert »

Kees,
The conversion is automatic :

Code: Select all

local oDt as DateTime
local dToday as DATE
oDt := DateTime.Now
dToday := oDt // implicit conversion
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply