LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problems using Union All

Hi, My name is Peres and...

I have a pivot table that uses another xls as database
Into this xls I have 2 tables of data with equal fields.
The fields Custo and Qdade are numerics fields but may have no data into it.

1-When I use CDbl() function to get the decimal numbers, it cause error when
the lines are blank
2- when I try to use AS to obtain a proper name of the field, it
disappear form the statements.

How can I write this to work well? thanks!

This is what I did But remember: it works if there are number in Custo and
Qdade and "AS" looks as if not existed:

SELECT tabela1.Até, tabela1.Atividade, tabela1.Categoria,
CDbl(tabela1.Custo) as custo, tabela1.De, tabela1.`Detalhe da Atividade`,
tabela1.Filial, tabela1.Grupo, tabela1.Mês, tabela1.Observações,
cdbl(tabela1.Qdade) as Quantidade, tabela1.Regional, tabela1.Semana,
tabela1.`Tipo de Gasto`
FROM `C:\Base_Book`.tabela1 tabela1
WHERE (tabela1.Atividade Is Not Null)
Union all SELECT tabela2.Até, tabela2.Atividade,
tabela2.Categoria,cdbl(tabela2.Custo) as Custo, tabela2.De, tabela2.`Detalhe
da Atividade`, tabela2.Filial, tabela2.Grupo, tabela2.Mês,
tabela2.Observações,cdbl(tabela2.Qdade) as Quantidade, tabela2.Regional,
tabela2.Semana, tabela2.`Tipo de Gasto`
FROM `C:\Base_Book`.tabela2 tabela2
WHERE (tabela2.Atividade Is Not Null)

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
union range Curt Excel Discussion (Misc queries) 9 April 20th 07 02:32 PM
UNION of Arrays - is possible? Marina Limeira Excel Discussion (Misc queries) 1 January 22nd 06 12:38 PM
Help w/ Union Queries Jenn Excel Discussion (Misc queries) 1 January 12th 05 01:07 AM
Union only works for sometimes. Shu Excel Programming 3 December 14th 03 01:25 PM
VBA union of two ranges s[_2_] Excel Programming 1 August 21st 03 02:18 AM


All times are GMT +1. The time now is 09:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"