SQL Union All lost (missing) data

  • Thread starter Thread starter CCrew2000
  • Start date Start date
C

CCrew2000

I'm merging two queries togther using the SQL coding shown below. For some
reason, I'm able to merge all the data together except the [JE Amt] from
query [Bt - JE 50]. The cells in question are blank. How can i figure out
what isn't working?

SELECT [company code], [account # to], [cost center to], [JE Amt], [sign],
[descr], [material #], [payer], [customer], [dist channel]
FROM [Bt - JE 40]

UNION ALL
SELECT [company code], [account # to], [cost center], [JE Amt], [sign],
[descr], [material #], [payer], [customer], [dist channel]
FROM [Bt - JE 50]
 
Are you getting an error message? If so, what? If not, how do you know you
have a problem?

Is this a computed column? If so, you might want to try forcing it to a
specific data type using one of the conversion functions. If the query is
returning NULL values, then Access may be having difficulty determining the
field type.

cdbl([JE Amt])

You might actually want to do this conversion in the two sub-queries.

HTH
Dale
 
No error message. Just blank cells in that column of [JE Amt]. There should
be numbers showing in the merged query, b/c there are numbers in the query
that its pulling from.

Dale Fye said:
Are you getting an error message? If so, what? If not, how do you know you
have a problem?

Is this a computed column? If so, you might want to try forcing it to a
specific data type using one of the conversion functions. If the query is
returning NULL values, then Access may be having difficulty determining the
field type.

cdbl([JE Amt])

You might actually want to do this conversion in the two sub-queries.

HTH
Dale
--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



CCrew2000 said:
I'm merging two queries togther using the SQL coding shown below. For some
reason, I'm able to merge all the data together except the [JE Amt] from
query [Bt - JE 50]. The cells in question are blank. How can i figure out
what isn't working?

SELECT [company code], [account # to], [cost center to], [JE Amt], [sign],
[descr], [material #], [payer], [customer], [dist channel]
FROM [Bt - JE 40]

UNION ALL
SELECT [company code], [account # to], [cost center], [JE Amt], [sign],
[descr], [material #], [payer], [customer], [dist channel]
FROM [Bt - JE 50]
 
I'm merging two queries togther using the SQL coding shown below. For some
reason, I'm able to merge all the data together except the [JE Amt] from
query [Bt - JE 50]. The cells in question are blank. How can i figure out
what isn't working?

SELECT [company code], [account # to], [cost center to], [JE Amt], [sign],
[descr], [material #], [payer], [customer], [dist channel]
FROM [Bt - JE 40]

UNION ALL
SELECT [company code], [account # to], [cost center], [JE Amt], [sign],
[descr], [material #], [payer], [customer], [dist channel]
FROM [Bt - JE 50]

What's the datatype of [JE Amt]? If you look at each query individually is
there data in the field? If it's a calculated field doublecheck that the
calculation is done exactly the same way in both queries... perhaps you could
post the SQL of the underlying queries.

John W. Vinson [MVP]
 
Back
Top