Reading DateTime values from Access mdb
Posted: 25.09.2012, 15:54
Hi,
I've an Access database with a table aTable and columns SysTime (Date/Time) and Value (float). I create the following query:
Query->SQL->Text = "SELECT SysTime, Value FROM aTable WHERE SysTime >= :from AND SysTime <= :to"
// fill in pars
Query->Params->FindParam("from")->AsDateTime = FromTime;
Query->Params->FindParam("to")->AsDateTime = ToTime;
// open
Query->Open();
That runs all OK, giving the correct number of records and the correct Value's.
double pvalue = Query->FindField("Value")->AsFloat; // correct pvalue
HOWEVER, the date/time values give only the Date part:
double tfloat = Query->FindField("SysTime")->AsFloat; // gives only integer
TDateTime Datetime = Query->FindField("SysTime")->AsDateTime; // gives only Date part
How to retrieve the full Date/Time values from Access Mdb?
Thanks in advance
Regards, Henk
I've an Access database with a table aTable and columns SysTime (Date/Time) and Value (float). I create the following query:
Query->SQL->Text = "SELECT SysTime, Value FROM aTable WHERE SysTime >= :from AND SysTime <= :to"
// fill in pars
Query->Params->FindParam("from")->AsDateTime = FromTime;
Query->Params->FindParam("to")->AsDateTime = ToTime;
// open
Query->Open();
That runs all OK, giving the correct number of records and the correct Value's.
double pvalue = Query->FindField("Value")->AsFloat; // correct pvalue
HOWEVER, the date/time values give only the Date part:
double tfloat = Query->FindField("SysTime")->AsFloat; // gives only integer
TDateTime Datetime = Query->FindField("SysTime")->AsDateTime; // gives only Date part
How to retrieve the full Date/Time values from Access Mdb?
Thanks in advance
Regards, Henk