USUÁRIO:      SENHA:        SALVAR LOGIN ?    Adicione o VBWEB na sua lista de favoritos   Fale conosco 

 

  Fórum

  Visual Basic
Voltar
Autor Assunto:  consulta com 2 tabelas
Edson479
SÃO PAULO
SP - BRASIL
ENUNCIADA !
Postada em 14/08/2008 16:07 hs            
boa tarde..
aqui tem varias dica sobre este tema mais nao estou conseguinda
eu tenho duas tabelas com nomes fichas e valores
na tabela fichas o campo e cod_fic
na tabela valores o campo e cod_fic
esta dica deve ser aminha mais não deu certo, alguel poderia da uma uma dica
 
       'select * from produtos where nome produto in (select nome from produtosvendidos where nome = 'banana')
 
eu motei assim
SQL = "select * from fichas where cod_fic in (select cod_fic from valores where cod_fic = '" & txtCon.Text & "'"
   
José Ari
MANAUS
AM - BRASIL
ENUNCIADA !
Postada em 14/08/2008 16:47 hs            
qual o erro q ta retornando??

================================================================
O Aprendizado é Direito de Todos. O Saber é Privilégio de Poucos.

Começando a estudar VB.NET. Realmente é incrível!!!!

   
Edson479
SÃO PAULO
SP - BRASIL
ENUNCIADA !
Postada em 14/08/2008 17:00 hs            
nem um erro mais tambem não carrega
   
Edson479
SÃO PAULO
SP - BRASIL
ENUNCIADA !
Postada em 14/08/2008 17:07 hs            
agora eu estou usando assim
 
    If rsPaciente.State = 1 Then rsPaciente.Close
    SQL = "SELECT * FROM fichas where cod_fic= '" & txtCon.Text & "'"
    rsPaciente.Open SQL, cnSQL, adOpenForwardOnly, adLockOptimistic
   
    If RsHistoric.State = 1 Then RsHistoric.Close
    SQLHis = "SELECT * FROM valores where cod_fic= '" & txtCon.Text & "'"
    RsHistoric.Open SQLHis, cnSQL, adOpenForwardOnly, adLockOptimistic
       
    If (Trim(txtCon.Text) = Empty) = False Then
       
        If rsPaciente.EOF Then
            frmError.F.Cls
            frmError.F.Print "Não há registros informado"
            frmError.Show vbModal
            DoEvents
        Else
            lblNom.Caption = rsPaciente.Fields("nom_fic")
            lblFic.Caption = rsPaciente.Fields("cod_fic")
            lblLoj.Caption = rsPaciente.Fields("loj_fic")
            lblEnt.Caption = rsPaciente.Fields("ent_fic")
            lblPla.Caption = rsPaciente.Fields("pla_fic")
            lblSer.Caption = rsPaciente.Fields("ser_fic")
            lblVal.Caption = Format(rsPaciente.Fields("val_fic"), "#,##0.00")
            txtEnt.Text = Format(Date, "dd/mm/yyyy")
        End If
        End If
        If rsPaciente.State = 1 Then rsPaciente.Close
        Set rsPaciente = Nothing
       
    While Not RsHistoric.EOF
        Set lst = ListView1.ListItems.Add(, , Format(RsHistoric("dat_fic"), "dd/mm/yyyy"))
        lst.SubItems(2) = Format(RsHistoric("des_val"), "###,##0.00")
        Des = Des + Format(RsHistoric("des_val"), "###,##0.00")
        RsHistoric.MoveNext
    Wend
    lblRec.Caption = Format(Des, "###,##0.00")
    If RsHistoric.State = 1 Then RsHistoric.Close
    Set RsHistoric = Nothing
   
Página(s): 1/1    


Seu Nome:

Seu eMail:

ALTERAR PARA MODO HTML
Mensagem:

[:)] = 
[:P] = 
[:(] = 
[;)] = 

HTML DESLIGADO

     
 VOLTAR

  



CyberWEB Network Ltda.    © Copyright 2000-2025   -   Todos os direitos reservados.
Powered by HostingZone - A melhor hospedagem para seu site
Topo da página