Re: product query - need an expert

2008-04-01 Thread Greg Morphis
Yeah that just seemed like the logical thing to do.. Have a good one! On Tue, Apr 1, 2008 at 12:02 AM, Mike Little <[EMAIL PROTECTED]> wrote: > ok guys, i think all is resolved quite nicely. am now inputting all stock > levels in just the product_to_product_options (thank god for those table > a

Re: product query - need an expert

2008-03-31 Thread Mike Little
ok guys, i think all is resolved quite nicely. am now inputting all stock levels in just the product_to_product_options (thank god for those table aliases!!) table. this has made is so much easier. simply doing a SUM of the stock levels to see if a product has positive stock levels. thanks all

Re: product query - need an expert

2008-03-31 Thread Azadi Saryev
something like: [note: something quick before my first cup of Lao Mountain Coffee... beware...] SELECT p.product_id, p.stock_level, ptop.product_options_id, ptop.stock_level AS o_stock_level, po.product_option_title FROM products p LEFT JOIN (product_options po INNER JOIN product_to_product_opti

Re: product query - need an expert

2008-03-31 Thread Azadi Saryev
i suppose then left joining your tables and using cfif|cfelse/cfswitch|cfcase logic at output can do the trick? Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ Mike Little wrote: > good question, at this stage being able to display all with like you said - a > availability flag would be q

Re: product query - need an expert

2008-03-31 Thread Azadi Saryev
hy not make each product option a different > product? Seems it would simplify what you need to do. > > Mark > > -Original Message- > From: Mike Little [mailto:[EMAIL PROTECTED] > Sent: Monday, March 31, 2008 8:46 PM > To: CF-Talk > Subject: product query - need

RE: product query - need an expert

2008-03-31 Thread Mark Fuqua
, March 31, 2008 8:46 PM To: CF-Talk Subject: product query - need an expert help! i am stuck... ok, for my product catalogue i have included a basic inventory system. product - product_id track_stock BIT stock_level INT reorder_level INT product_to_product_options

Re: product query - need an expert

2008-03-31 Thread Mike Little
good question, at this stage being able to display all with like you said - a availability flag would be quite good. >do you want to display on your summary page only products that are in >stock, or all products with 'unavailable' for those out of stock? > >Azadi Saryev >Sabai-dee.com >http://www

Re: product query - need an expert

2008-03-31 Thread Azadi Saryev
do you want to display on your summary page only products that are in stock, or all products with 'unavailable' for those out of stock? Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ Mike Little wrote: > > i need to develop a system for displaying products on a summary page. > > ~

Re: product query - need an expert

2008-03-31 Thread Greg Morphis
It wouldn't be null you could make it "0". Having the product stock in one table would make it easier to maintain also On Mon, Mar 31, 2008 at 8:12 PM, Mike Little <[EMAIL PROTECTED]> wrote: > hmmm... yes this could be an option. i was a little unsure of the default > record for the ptpo table eg

Re: product query - need an expert

2008-03-31 Thread Mike Little
hmmm... yes this could be an option. i was a little unsure of the default record for the ptpo table eg. would it be a good idea to have a null product_options_id? >Maybe have a default or generic "option", set the id to 0.. That way >ALL stock totals will be in one table instead of 2. >It'd make

Re: product query - need an expert

2008-03-31 Thread Mike Little
SQL server mike. >It might help to know which database you are using (SQL Server?). >There are many ways to do this, but I don't think you provided enough >detail to identify the best method. Below is one method. > >SELECT 1 >FROM product p >WHERE product_id = #id# >AND >(stock_level > 0 >OR EXIS

Re: product query - need an expert

2008-03-31 Thread Greg Morphis
Maybe have a default or generic "option", set the id to 0.. That way ALL stock totals will be in one table instead of 2. It'd make it easier to query also. On Mon, Mar 31, 2008 at 7:45 PM, Mike Little <[EMAIL PROTECTED]> wrote: > help! i am stuck... > > ok, for my product catalogue i have includ

Re: product query - need an expert

2008-03-31 Thread Mike Chabot
It might help to know which database you are using (SQL Server?). There are many ways to do this, but I don't think you provided enough detail to identify the best method. Below is one method. SELECT 1 FROM product p WHERE product_id = #id# AND (stock_level > 0 OR EXISTS ( SELECT 1 FROM produ

product query - need an expert

2008-03-31 Thread Mike Little
help! i am stuck... ok, for my product catalogue i have included a basic inventory system. product - product_id track_stock BIT stock_level INT reorder_level INT product_to_product_options -- product_id product_options_id stock_level INT reorder_level INT pro