Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to select rows that not meet a join condition

Status
Not open for further replies.

bmeza

MIS
Dec 2, 2005
7
MX
hi, how can i do to select those invoices that their numbers parts have rate "tlcan" and dont have a valid "tlcan" certificate of origin for the invoice date

select claused have 3 tables and a just want those rows that not meet the join condition

here its my code

select invoice, date, part, line from
certorig inner join impmov on part=co_part inner join impfact on invoice=invoicem
and date between co_datei and co_datef and rate='TLCAN'
and co_trat='TLCAN'

 
Code:
[COLOR=blue]select[/color] invoice, [COLOR=blue]date[/color], part, line
       [COLOR=blue]from[/color] certorig
       [COLOR=blue]inner[/color] [COLOR=blue]join[/color] impmov [COLOR=blue]on[/color] part=co_part
       [COLOR=#FF00FF]LEFT[/color] [COLOR=blue]join[/color] impfact [COLOR=blue]on[/color] invoice=invoicem                    and
                             [COLOR=blue]date[/color] between co_datei and co_datef and
                             rate    = [COLOR=red]'TLCAN'[/color]                  and
                             co_trat = [COLOR=red]'TLCAN'[/color]
[COLOR=blue]WHERE[/color] impfact.invoicem [COLOR=blue]IS[/color] NULL

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top