> Please describe how you are doing the export.
> When I do the export using the query I described in my previous answer, I
[quoted text clipped - 137 lines]
> >> >> >> have to begin anew.
> >> >> >> thanks for your help
Using your extra info, here is the problem.
The field YTDH would be better done slightly differently.
My suggestion is to scrap the CInt and the +0.5
Replace with YTDH:CStr([prearn].[ytdhours])
Create a new export spec using a query with Comp, EmpNo, YTDH ( the new
YTDH)
This will export all 3 fields as text.
Exporting YTDH as text, will stop the export process from adding decimal
points.
Jeanette Cunningham
> Thanks for taking the time Jeanette,
> step 1: ODBC to table and run a Make-Table query.
[quoted text clipped - 177 lines]
>> >> >> >> have to begin anew.
>> >> >> >> thanks for your help
DumbCluck - 25 Apr 2008 13:25 GMT
Hey Jeanette,
I changed it as you suggested to CStr and the Make-Table query still sets
the format to Number. I manually changed the format on design table and
when I
run the make table query, it changes it back to a number even with the CStr
formula.
Its as if there are demons screwing with me.
I changed the field to 3 bytes which truncates the decimal when the value is
100 or more. I will have to change it to 4 bytes when individuals accumulate
1000 hours for the year. I have never had such a difficult time with a
project in my life.
Thanks for your help.
> Using your extra info, here is the problem.
>
[quoted text clipped - 191 lines]
> >> >> >> >> have to begin anew.
> >> >> >> >> thanks for your help
DumbCluck - 25 Apr 2008 16:30 GMT
Hey Jeanette,
the CStr formula brought the values into the table (500.00, 580.98, etc)
so I changed the formula to CStr(Round(prearn.YTDH)). It converts the
values to
a text string in the table. (no decimals)
Then when I run the query, there are no decimals visible when I visually
check out
the output.
When I export it to a text file, the %$#@*&% decimal is back. Demons I swear!
> Using your extra info, here is the problem.
>
[quoted text clipped - 191 lines]
> >> >> >> >> have to begin anew.
> >> >> >> >> thanks for your help
Jeanette Cunningham - 25 Apr 2008 22:31 GMT
Hi,
there are several places in this scenario where something can go wrong.
1. when you use a make table query, you have very little control over how
the data types are set up.
I was assuming (silly thing) that you would export the query I gave you.
Instead you used it as the basis for a make table query.
2. The calculated field with CStr([TheField]) needs to be in the final query
that is exported.
3. Your last post showed the numbers as integers, so I assumed (again silly
thing) that you were dealing with long integers. This post shows that you
are dealing with singles. Is this correct? Is prearn.ytdh a single?
4.It would be easier to skip the make table query altogether.
Use a table that you have built specially for this purpose. Set up the data
types as you want them.
Create an export query based on the export table.
Each time you want add data to the export table, you can delete all the
current data before you add the new data.
Here's how:
I will call the table tblExport for this discussion.
tblExport has 3 fields, the first two are text fields for comp and empno,
the 3rd field YTDH is a number field with field size set to single.
5.Create a query based on tblExport
In this query use a calculated field called FinalYTDHC: Str((CInt([YTDH]))
6. Export the query
Note: the order of the steps is important.
The last thing before export is to convert the number to an integer and then
a string - no more changes to YTDH before you export it.
Jeanette Cunningham
> Hey Jeanette,
> the CStr formula brought the values into the table (500.00, 580.98, etc)
[quoted text clipped - 228 lines]
>> >> >> >> >> have to begin anew.
>> >> >> >> >> thanks for your help