Hi 

I am storing measurement info for a product, each product has numerous parts, 
and each part has numerous measurements.

Once the product has been created with all its part numbers and measurements i 
need to loop through the measurements and make sure each part has the exact 
same amount of measurements inserting n/a in the appropriate place.

EG:

Product 1
Part No 12
Measurements:  A=12 B=13 C=14

Product 1
Part No 13 
Measurements: A=12 B=n/a C=13

In the example above part no 13 only has two real measurements, but part no 12 
has three real measurements, i need to be able to fill in the missing 
measurement with n/a. Please see below query set up.

<!----//Step 1: Get the product in question--->


<cfquery name="get_products" datasource="#application.dsn#">
SELECT products.productID, products.psubCatID, products.productName, 
products.productDescription
FROM products
WHERE productID = #prodID#
</cfquery>


<!---//Step 2: Get the related product parts and measurements--->

<cfquery name="get_meas" datasource="#application.dsn#">
SELECT pp.productPartID, pp.partProdID, pp.partNo, m.mTitle, m.measOne
FROM productPart pp INNER JOIN measurement m ON pp.productPartID = m.mPartID
WHERE pp.partProdID = #get_products.productID#
</cfquery>

I think i need to set the query above to get the part no with the most amount 
of measurements, loop through the list and insert into other part numbers the 
missing measurements.

m.mtitle is used for A,B,C,D etc
m.measOne is used for the measurement

i.e mtitle=A measOne = 12

Any ideas

Jason

Jason Congerton
tel: +44 (0)1923 711605
mob: +44 (0)7811 250070


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328831
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to