F
frank
I'm using Access 2002 on WXP.
A double-precision number, 7 digits before the decimal and 3-8 digits after
the decimal (typical value - 2547855.6511) is truncated to the 7 digits
before the decimal and only two digits after. It is not simply dropping
zeros, it is truncating non-zero values. The problem is the same on two
different machines (on two different networks).
I first noticed the problem when I successfully set up some VBA code to do
it:
varSQL = "SELECT DESIG, NAME, DATE, MAGMOD, MAG, CODES, COMPS, CHART, OBS,
REMARKS FROM tblObservations WHERE Submit = " & "True ORDER BY DATE DESC"
Set db = CurrentDb()
Set rsobs = db.OpenRecordset(varSQL)
rsobs.MoveFirst
rsobs.MoveLast
varnumrecords = rsobs.RecordCount
MsgBox "There are " & varnumrecords & " records to submit"
For Each qdf In db.QueryDefs
If qdf.NAME = "qryObservationsSubmit" Then
db.QueryDefs.Delete qdf.NAME
End If
Next qdf
Set qdf = db.CreateQueryDef("qryObservationsSubmit", varSQL)
vardate = vardate & ".txt"
DoCmd.TransferText acExportFixed, "SubmitObsExport",
"qryObservationsSubmit", "c:\" & vardate
qdf.Close
This exports fine, but the DATE field is truncated to two digits to the
right of the decimal. In the underlying table, tblobservations, DATE is a
number, double, no format, Auto (it isn't a date, as such). The export spec,
SubmitObsExport, has the DATE field also a double-precision number.
I've been fooling with this all day. I abandoned the VBA and am just
exporting in a variety of different formats from the File menu on the
original table, changing the data type, changing from fixed to delimited,
changing the number of digits beyond the decimal in the data type format,
using a number of different targeted file types, and many other permutations
always produces some truncation of the data, except when I change the DATE
field type to text. This is not a good solution however, because it needs to
be a number for other purposes.
I've also created new databases and new tables, always with the same result.
I searched MS Knowledgebase, but there are many many articles on exporting
data from Access and none of them mention my problem as near as I can tell.
I'm missing something obvious, but what is it?
Frank
A double-precision number, 7 digits before the decimal and 3-8 digits after
the decimal (typical value - 2547855.6511) is truncated to the 7 digits
before the decimal and only two digits after. It is not simply dropping
zeros, it is truncating non-zero values. The problem is the same on two
different machines (on two different networks).
I first noticed the problem when I successfully set up some VBA code to do
it:
varSQL = "SELECT DESIG, NAME, DATE, MAGMOD, MAG, CODES, COMPS, CHART, OBS,
REMARKS FROM tblObservations WHERE Submit = " & "True ORDER BY DATE DESC"
Set db = CurrentDb()
Set rsobs = db.OpenRecordset(varSQL)
rsobs.MoveFirst
rsobs.MoveLast
varnumrecords = rsobs.RecordCount
MsgBox "There are " & varnumrecords & " records to submit"
For Each qdf In db.QueryDefs
If qdf.NAME = "qryObservationsSubmit" Then
db.QueryDefs.Delete qdf.NAME
End If
Next qdf
Set qdf = db.CreateQueryDef("qryObservationsSubmit", varSQL)
vardate = vardate & ".txt"
DoCmd.TransferText acExportFixed, "SubmitObsExport",
"qryObservationsSubmit", "c:\" & vardate
qdf.Close
This exports fine, but the DATE field is truncated to two digits to the
right of the decimal. In the underlying table, tblobservations, DATE is a
number, double, no format, Auto (it isn't a date, as such). The export spec,
SubmitObsExport, has the DATE field also a double-precision number.
I've been fooling with this all day. I abandoned the VBA and am just
exporting in a variety of different formats from the File menu on the
original table, changing the data type, changing from fixed to delimited,
changing the number of digits beyond the decimal in the data type format,
using a number of different targeted file types, and many other permutations
always produces some truncation of the data, except when I change the DATE
field type to text. This is not a good solution however, because it needs to
be a number for other purposes.
I've also created new databases and new tables, always with the same result.
I searched MS Knowledgebase, but there are many many articles on exporting
data from Access and none of them mention my problem as near as I can tell.
I'm missing something obvious, but what is it?
Frank