Hey Everyone,
Well i am having a problem outputting for my report and hoping someone can explain what i am doing wrong.
What the report is about is comparing my company's part price's to d and h, synnex and techdata. What i was told to do was take are part numbers and combine them with d and h, synnex and techdata to display only one column of parts (did this). Then i was told to create a cfloop using the query i created to combine the parts (did this). then inside the cfloop i created a cfif for each company, doing the cfif is suppose to get the price for each company(did this).Then i was told to add a loop control variable so that if one price is empty it will skip it instead of add the next price.
The problem is that i was able to get one price to output, but now i can not get any of the prices to output at all an not sure what i am doing wrong. Before i added a loop control variable i was able to output techdata's prices by doing #techdata.cost# but now with the loop control variable i am not able to. I was also not able to output synnex and techdata before adding the loop control variable, but i was told that how i was outputting it could be the problem. if anyone could tell me what i am doing wrong, atleast to how i am displaying techdata i would really appreciate it. Here is what i currently have.
Thank you,
Rachel
Well i am having a problem outputting for my report and hoping someone can explain what i am doing wrong.
What the report is about is comparing my company's part price's to d and h, synnex and techdata. What i was told to do was take are part numbers and combine them with d and h, synnex and techdata to display only one column of parts (did this). Then i was told to create a cfloop using the query i created to combine the parts (did this). then inside the cfloop i created a cfif for each company, doing the cfif is suppose to get the price for each company(did this).Then i was told to add a loop control variable so that if one price is empty it will skip it instead of add the next price.
The problem is that i was able to get one price to output, but now i can not get any of the prices to output at all an not sure what i am doing wrong. Before i added a loop control variable i was able to output techdata's prices by doing #techdata.cost# but now with the loop control variable i am not able to. I was also not able to output synnex and techdata before adding the loop control variable, but i was told that how i was outputting it could be the problem. if anyone could tell me what i am doing wrong, atleast to how i am displaying techdata i would really appreciate it. Here is what i currently have.
Code:
[U]This combines all the parts[/U]
<cfquery name="matchmanu" datasource="Configurator">
select a.[hc part number]'hcpartnumber',a.mpn,a.Mfg,a.lastbuyquote,a.[description],b.prodid,c.distisku,c.distiid
from [svr-htssqldb].configurator.dbo.[Master Parts List] a
inner join [svr-htssqldb2].cnet_datasource.cnet_connector.cds_prod b
on a.mpn=b.mfpn
inner join [svr-htssqldb2].cnet_datasource.cnet_connector.cds_metamap c
on b.prodid=c.prodid
where a.lastbuyquote is not null and (c.distiid='c00030' or c.distiid='c00055' or c.distiid='c00791')
</cfquery>
<table width="95%" align="center">
<thead>
<tr>
<th>Manu Part number </th>
<th>Techdata_Price</th>
<th>Synnex Price</th>
<th>D&H Price</th>
</tr>
</thead>
<cfset alt=0>
<cfset classStr="">
<cfoutput>
<cfloop query="matchmanu">
<cfset t = 1>
[U]this gets the prices for techdata[/U]
<cfif distiid EQ 'C00030'>
<cfquery name="techdata#t#" datasource="Distributor">
Select COST
From dbo.PRODUCTS
where PART_NUM = '#matchmanu.distisku#'
</cfquery>
<cfelse>
</cfif>
<cfset t = t + 1>
<cfset s = 1>
[U]this gets the prices fo synnex[/U]
<cfif distiid EQ 'C00055'>
<cfquery name="synnex#s#" datasource="Distributor">
Select Unit_Cost__wo_PromoRebate
From dbo.tbl_synnex_price
where SYNNEX_SKU = '#matchmanu.distisku#'
</cfquery>
<cfelse>
</cfif>
<cfset s = s + 1>
<cfset d = 1>
[U]this gets the prices for dandh[/U]
<cfif distiid EQ 'C00791'>
<cfquery name="dandh#d#" datasource="Distributor">
Select unit_cost
From dbo.tbl_dandh_price
where dandh_item_num = '#matchmanu.distisku#'
</cfquery>
<cfelse>
</cfif>
<cfset d = d + 1>
<cfif alt eq 0>
<cfset classStr="">
<cfset alt=1>
<cfelse>
<cfset alt=0>
</cfif>
<tr>
<td class="#classStr#">
#matchmanu.distisku#
</td>
[U]this outputs techdata[/U]
<td class="#classStr#">
#techdata#t#.COST#
</td>
thisoutputs synnex
<td class="#classStr#">
#synnex.Unit_Cost__wo_PromoRebate#
</td>
[U]this outputs dandh[/U]
<td class="#classStr#">
#dandh.unit_cost#
</td>
</tr>
</cfloop>
</cfoutput>
</table>
Rachel
Comment