Hi,
I was wondering if someone could help me, i have nearly complete my site and need some help creating the queries to produce my commission and pipeline.
my table structure is:
CREATE TABLE `pipeline_commission` (
`ProductID` varchar(75) NOT NULL,
`Pip_CommID` int(11) NOT NULL auto_increment,
`PipComm_UserID` int(11) default NULL,
`clients_ClientID` int(11) default NULL,
`Amount` decimal(14,2) default NULL,
`LenderProvider` varchar(50) default NULL,
`DueDate` date default NULL,
`DatePaid` date default NULL,
PRIMARY KEY (`Pip_CommID`),
KEY `Pipeline_UserID` (`PipComm_UserID`),
KEY `clients_ClientID` (`clients_ClientID`),
KEY `ProductID` (`ProductID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=69 ;
I need have did a sum for the amount to show how much money is there (amount)but how do i do the following:
1.If the datepaid column has a value then it is then classed as commission paid, how do i query that?
2.If the datepaid column is empty then it is in the pipeline to be paid, how do i query that?
3.I want to then show the above pipeline/commission for each userid, clientid and provider/lender. how can i query this?
Thanks again for all your guys help.