Quantcast
Channel: SQLServerCentral » Reporting Services » Reporting Services » Latest topics
Viewing all articles
Browse latest Browse all 2791

SQL Query table relationships issue

$
0
0
In the query below, the relationship between the tables tblDataPermit and tblDataFees is the application number. If the application number in tblDataPermit does not appear in tblDateFees then the entire item does not appear in the query result. I still need the tblDataPermit data to appear, but with the tblDateFees column blank or zero.>>SELECT tblDataPermit.ApplicationNumber ,tblDataPermit.PermitNumber ,tblDataPermit.Type ,tblDataPermit.Status ,tblDataPermit.ApplicationType ,tblDataParcel.StreetName ,tblDataParcel.StreetNum ,tblDataParcel.Location ,tblNumbersApplication.Number AS [tblNumbersApplication Number] ,tblNumbersApplication.Label AS [tblNumbersApplication Label] ,tblNumbersApplicationStatus.Number AS [tblNumbersApplicationStatus Number] ,tblNumbersApplicationStatus.Label AS [tblNumbersApplicationStatus Label] ,tblDataPermit.PermitCost ,tblDataFees.ApplicationNumber AS [tblDataFees ApplicationNumber] ,tblDataFees.Amount ,tblDataPermit.IssueDateFROM tblDataPermit INNER JOIN tblDataParcel ON tblDataPermit.ParcelID = tblDataParcel.ParcelID INNER JOIN tblNumbersApplication ON tblDataPermit.Type = tblNumbersApplication.Number INNER JOIN tblNumbersApplicationStatus ON tblDataPermit.Status = tblNumbersApplicationStatus.Number INNER JOIN tblDataFees ON tblDataPermit.ApplicationNumber = tblDataFees.ApplicationNumberWHERE tblDataPermit.Type = @Type AND tblDataPermit.Status IN (@Status) AND tblDataPermit.IssueDate >= @IssueDate AND (tblDataPermit.IssueDate <= @IssueDate2 OR tblDataPermit.IssueDate IS NULL)>>

Viewing all articles
Browse latest Browse all 2791

Trending Articles