hi,
i have just applied a view to my database and when tested works fine if their is a value from the tasks and allrenewals tables of "clientID" or clients_ClientID however i need to be able to view the entries even if the clientid or clients_clientid from the 2 tables is null.
i cannot seem to get it right and have tried changing the join around to 3 different combinations.
hope someone can help urgently.
CREATE ALGORITHM=UNDEFINED DEFINER=`web1local-local`@`%` SQL SECURITY DEFINER VIEW `calendar` AS
select `p`.`TaskID` AS `TaskID`,'tasks' AS `Task`,`c`.`ClientID` AS `ClientID`,`c`.`App1FirstName` AS `App1FirstName`,`c`.`App1LastName` AS `App1LastName`,
`c`.`App2FirstName` AS `App2FirstName`,`c`.`App2LastName` AS `App2LastName`,`u`.`UserID` AS `UserID`,`u`.`FirstName` AS `Firstname`,
`u`.`LastName` AS `Lastname`,`p`.`TaskTitle` AS `Title`,`p`.`TaskDueDate` AS `DueDate`,`p`.`Completed` AS `NPW`,`p`.`ProductAssociated` AS `Product`,`p`.`TaskDescription` AS `Description`
from ((`clients` `c` join `tasks` `p` on((`c`.`ClientID` = `p`.`clients_ClientID`))) join `users` `u` on((`p`.`Tasks_UserID` = `u`.`UserID`)))
where `p`.`Completed` = 'No'
union select `p`.`Product` AS `Product`,'allrenewals' AS `Review`,`c`.`ClientID` AS `ClientID`,`c`.`App1FirstName` AS `App1FirstName`,`c`.`App1LastName` AS `App1LastName`,
`c`.`App2FirstName` AS `App2FirstName`,`c`.`App2LastName` AS `App2LastName`,`u`.`UserID` AS `UserID`,`u`.`FirstName` AS `FirstName`,
`u`.`LastName` AS `LastName`,`p`.`ProductID` AS `Title`,`p`.`ReviewDate` AS `DueDate`,`p`.`NPW` AS `NPW`,`p`.`ProductID` AS `Product`,`p`.`Provider` AS `Description`
from ((`clients` `c` join `allrenewals` `p` on((`c`.`ClientID` = `p`.`ClientID`))) join `users` `u` on((`p`.`UserID` = `u`.`UserID`)))
WHERE `p`.`NPW` = 'N';
thanks