Jump to content

wierd (IMO) query .. help me build please


severndigital

Recommended Posts

i need to get the SUM of a field from one table based off a range in another table

 

here's what i think it should should like in the end, but of course it isn't working

 

SELECT SUM(prd.qty) FROM order_products prd
WHERE 
order_list.datemade BETWEEN UNIX_TIMESTAMP('2008-10-01') AND UNIX_TIMESTAMP('2008-10-31')

 

i should mention that the tables look like this

order_list table

id

datemade

etc....

 

order_prods table

id

orderid

prodid

qty

etc...

 

 

 

 

 

i just can't get this query to show up. Any suggestions??

 

Thanks

-C

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/133102-wierd-imo-query-help-me-build-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.