Hi Everyone, I have written a SQL query but do not know how to execute it so that it outputs to a report. The SQL statment is behind a form that the user enters values into that determine what the report displays.
How can I get the output to display?
strSQl = "SELECT Clients.Active, Clients.Player, Deals.NContractStatus, " _
& "Deals.Company, Deals.[Deal Terms], Deals.Notes, Deals.ContractID, " _
& "Deals.From, Deals.To, Clients.Rep " _
& "FROM Clients INNER JOIN (Deals INNER JOIN [Deal Detail] ON Deals.DealID = [Deal Detail].DEALID) ON Clients.ID = Deals.ClientId " _
& "where clients.active = -1"
If Me!AllDates = -1 Then
Else
strSQl = strSQl & " AND Deals.From >= " & Me!FromDate
strSQl = strSQl & " AND Deals.To <= " & Me!ToDate
End If
If Me!AllStatus = -1 Then
Else
strSQl = strSQl & " AND Deals.NContractStatus between me!fromstatus AND me!tostatus "
End If
Thanx
Trudye
How can I get the output to display?
strSQl = "SELECT Clients.Active, Clients.Player, Deals.NContractStatus, " _
& "Deals.Company, Deals.[Deal Terms], Deals.Notes, Deals.ContractID, " _
& "Deals.From, Deals.To, Clients.Rep " _
& "FROM Clients INNER JOIN (Deals INNER JOIN [Deal Detail] ON Deals.DealID = [Deal Detail].DEALID) ON Clients.ID = Deals.ClientId " _
& "where clients.active = -1"
If Me!AllDates = -1 Then
Else
strSQl = strSQl & " AND Deals.From >= " & Me!FromDate
strSQl = strSQl & " AND Deals.To <= " & Me!ToDate
End If
If Me!AllStatus = -1 Then
Else
strSQl = strSQl & " AND Deals.NContractStatus between me!fromstatus AND me!tostatus "
End If
Thanx
Trudye