I’m using TFDBatchMove
to transfer data from a table to a CSV file.
object FDBatchMoveDataSetReader1: TFDBatchMoveDataSetReader
DataSet = TblTrip
Left = 224
Top = 144
end
object FDBatchMove1: TFDBatchMove
Reader = FDBatchMoveDataSetReader1
Writer = FDBatchMoveTextWriter1
Mappings = <>
LogFileName = 'Data.log'
CommitCount = 999
OnProgress = FDBatchMove1Progress
OnWriteValue = FDBatchMove1WriteValue
Left = 280
Top = 96
end
object FDBatchMoveTextWriter1: TFDBatchMoveTextWriter
FileName = 'C:TempDump.txt'
DataDef.Fields = <>
DataDef.FormatSettings.ShortTimeFormat = 'HH:mm.zzz'
Left = 320
Top = 144
end
The table has a couple of TimeStamp fields:
object TblTrip: TFDTable
IndexFieldNames = 'TripPkey'
Connection = ADSConnection
UpdateOptions.UpdateTableName = 'TRIP'
TableName = 'TRIP'
Left = 40
Top = 240
...
object TblTripOpenedDateTime: TSQLTimeStampField
FieldName = 'OpenedDateTime'
Origin = 'OpenedDateTime'
DisplayFormat = 'mm/dd/yyyy hh:mm:ss.zzz'
end
No matter what settings I toggle on the TFDBatchMoveTextWriter
or the TSQLTimeStamp
field, I cannot get the output to include milliseconds.
Here’s a sample:
"208GVGqETJAY2:[4",2,"45745",1,2/13/2008 5:02:08 PM,,"","","",,F,F,0,F,F,F,F,F,,,"","","","",
I tried intercepting in the TFDBatchMove.OnWriteValue
event:
AValue := StrToDateTime(FormatDateTime('mm/dd/yyyy hh:mm:ss.zzz', AValue));
But I am not gaining any ground.
I need the milliseconds to be included in the output.
8