Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Uma linha origem , duas no final
Message
From
05/05/2003 11:51:04
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
05/05/2003 11:34:49
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00784971
Message ID:
00784985
Views:
13
This message has been marked as the solution to the initial question of the thread.
>Pessoal
>
>Numa Tabela tenho código , Valor a Débito , Valor a Crédito ,
>
>Ou seja Tabela1 têm os campos Cod , ValDeb , ValCre
>
>é possível que um registo , tenha por exemplo simultanemente um valor a débito e outro a crédito , por exemplo :
>
>Codigo1 , 50 , 20
>
>outro exemplo possível
>
>Codigo2 , 25 , 0
>
>Eu quero fazer um select que retorne um registo para o valor a débito , outro para valor a crédito , pegando nos exemplos acima , ficaria :
>
>Codigo1 , 50 , 0
>Codigo1 , 0 , 20
>Codigo2 , 25 , 0
>
>Fiz-me entender ?
>
>Muito obrigado pela ajuda
>
>Pedro Silva

Eu asumirei que ussa campos monetarios:
select codigo, debito, $0 as credito;
  union;
  select codigo, $0 as debito, credito;
  into cursor Temp;
  nofilter
select * from Temp;
  where debito # 0 or credito # 0;
  order by ...;
  into cursor Temp
HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform