> note the "ENTERPRISE ENCRYPTION CTR." ...thats my problem...it should
> be listing the right product for the product code that was given...it
> does...but it only the first record.  can anyone explain why ?
...
> <CFQUERY Name="knownissues" DataSource="CCMast">
> select *
> from nxsdfct
> order by defect_num desc
> </cfquery>
>
> <CFQUERY NAME="product_swap" DATASOURCE="ccmast">
> SELECT      dbo.nxsprodr.prod_desc
> FROM         dbo.nxsdfct, dbo.nxsprodr
> WHERE       dbo.nxsdfct.prod_code = dbo.nxsprodr.prod_code
> </CFQUERY>
>
> <table>
>
> <tr bgcolor="#CCCCCC">
> <td>date</td>
> <td>version</td>
> <td>product</td>
> <td>severity</td>
> <td>issue with</td>
> </tr>
>
> <cfoutput query="knownissues" maxrows="5">
>
> <tr bgcolor="#iif(Currentrow Mod 2, DE('DCDCDC'), DE('CCCCCC'))#">
> <td>#LSDateFormat("#entered_date#", "mmmm d, yyyy")#</td>
> <td>#prod_version#</td>
> (problem child)-->  <td>#product_swap.prod_desc#</td>
> <td>#severity#</td>
> <td><cfif "#defect_type#" eq "">not
> listed<cfelse>#defect_type#</cfif></td>
> </tr>
>
> </cfoutput>
>
> </table>

You're referencing product_swap.prod_desc, but you're looping over the query
"knownissues". Unless you loop over the product_swap query, it's always
going to return the first row of data. Your best bet is to get all the data
you want in a single query. If every issue has an associated product, simply
do an inner join:

<cfquery name="knownissues" datasource="ccmast">
        SELECT  nd.*,
                        np.prod_desc
        FROM            nxsdfct nd,
                        nxsprodr np
        WHERE           nd.prod_code = np.prod_code
</cfquery>

If some issues don't have associated products, you'll have to do an outer
join returning all the issues, and any matching products. Your WHERE clause
might look like this:

WHERE   nd.prod_code *= np.prod_code

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to