Jump to content

roxie

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

roxie's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Never mind I got it working
  2. Maq, Spanx darling Ok now one last thing and I think this thing will work Alright here is what I need to do: I need to figure the gross sales, refunded amount and net sales. I thought the database field "sales.refunded" was the amount refunded but it is only a boolean. So the the SUM and COUNT are the same. The amount refunded is the same as "sales.payment" I am completely at a loss here please help.
  3. Keith, Spanx hon!!! I still have an issue though but it isn't with the code but rather the mySQL db table. When I try to run even the simplest query (SELECT * FROM employees) against the employees table I get this: Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\wamp\www\sitefolder\admin\dsp_custom-report.php on line 27 Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\sitefolder\admin\dsp_custom-report.php on line 28 Any clue why I wouldn't be able to query the table? I even cut and pasted the table name from PHPMyAdmin incase one of them were misspelled. Spanx, Roxie
  4. Sorry Boys for not giving enough information about the issues OK here is the SQL SELECT sales.employeeID, SUM(sales.refunded) as refund_total, COUNT(sales.refunded) as refunds, SUM(sales.payment) as net, COUNT(sales.payment) as sales, COUNT(sales.purchased) as total_sales, sales.leadID, leads.leadID, leads.count, employees.employeeID, employees.firstName, employees.lastName FROM sales, employees, leads WHERE sales.purchased BETWEEN ('2011/01/01', 'yyyy/mm/dd') AND ('2011/12/31', 'yyyy/mm/dd') AND employees.employeeID = sales.employeeID AND leads.leadID = sales.leadID AND sales.productID = 1 OR sales.productID = 2 GROUP BY sales.affiliate ORDER BY sales I actually have a few issues: [*]This query fails and I get the following error; Database query failed: Operand should contain 1 column(s) [*]I can't figure out how to dynamically create the query to look for all of the checkboxes marked productID Spanx for your quick replies, Roxie
  5. Hello Boys, I'm having a hard time figuring out a query and it's more frustrating than sex with my last bf Okay here is the deal I have a database tables. Sales employeeID ~ Which of course identifies the employee leadID ~ This is to identify any sort of target marketing product ~ This is the product that was purchased. refunded ~ If any money was refunded on the order payment ~ This is how much money was collected. Leads leadID ~ Connects to Sales table count ~ this is how many people inquired about Employees employeeID firstName lastName So the query is ran on 1-?? product that are picked from a form with check boxes. Name Leads Sales Refunds Net Earnings Per Lead Can some one help a poor girl out? Pretty please with a kiss on top? Spanx, Roxie
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.