From: mactech999 on
ok For a 2005 Honda Civic this is the Result I get:

FHO-556 Front Disc Brake Rotor 2 F1 Sport Brake Rotors
Use with: SubModel: Hybrid
FHO-556 Front Disc Brake Rotor 2 F1 Sport Brake Rotors
Use with: 1.7L L4
HO-556 Front Disc Brake Rotor 2 AutoStar Drum & Rotor
Use with: SubModel: Hybrid
HO-556 Front Disc Brake Rotor 2 AutoStar Drum & Rotor
Use with: 1.7L L4
HO-584 Front Disc Brake Rotor 2 AutoStar Drum & Rotor
Use with: 2.0L L4
HOD-56 Rear Brake Drum 2 AutoStar Drum & Rotor
Use with: 1.7L L4


I would like it to be like this

FHO-556 Front Disc Brake Rotor 2 F1 Sport Brake Rotors
HO-556 Front Disc Brake Rotor 2 AutoStar Drum & Rotor
HOD-56 Rear Brake Drum 2 AutoStar Drum & Rotor
Use with: 1.7L L4

HO-584 Front Disc Brake Rotor 2 AutoStar Drum & Rotor
Use with: 2.0L L4

FHO-556 Front Disc Brake Rotor 2 F1 Sport Brake Rotors
HO-556 Front Disc Brake Rotor 2 AutoStar Drum & Rotor
Use with: SubModel: Hybrid


From: "JR "Bob" Dobbs" on
Take a look at the group attribute of the cfoutput tag. The CF8 documentation
includes a sample to demonstrate the use of the group attribute.
www.easycfm.com also has a tutorial on this topic.


http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_m-o_16.ht
ml#1101659
http://tutorial150.easycfm.com/

From: mactech999 on
Well you see thats where I have a problem

grouping would solve the problem however i am using this to get the display

The CfgDisplay is what gives the Description and it is not in Recordset1

is there a way of adding it in ?

<cfif #Recordset1.WheelBase# GT 0>
<cfquery name="rsWheel" datasource="Aces">
Select WheelBase From WheelBase Where WheelBaseID =
#Recordset1.WheelBase#
</cfquery>
<cfset CfgDisplay = CfgDisplay & "#Trim(rsWheel.WheelBase)#
WheelBase &nbsp; ">
</cfif>
<cfif #Recordset1.TransmissionBase# GT 0>
<cfquery name="rsTranBase" datasource="Aces">
Select [TransmissionType]![TransmissionTypeName]
[TransmissionControlType]![TransmissionControlTypeName]
[TransmissionNumSpeeds]![TransmissionNumSpeeds] As Expr1,
TransmissionBase.TransmissionBaseID
From TransmissionNumSpeeds Inner Join (TransmissionControlType
INNER
Join (TransmissionType Inner Join TransmissionBase On
TransmissionType.TransmissionTypeID
= TransmissionBase.TransmissionTypeID) ON
TransmissionControlType.TransmissionControlTypeID
= TransmissionBase.TransmissionControlTypeID) ON
TransmissionNumSpeeds.TransmissionNumSpeeds
= TransmissionBase.TransmissionNumSpeedsID
</cfquery>
<cfset CfgDisplay = CfgDisplay & "#Trim(rsTranBase.Expr1)#
Transmission &nbsp; ">
</cfif>
<cfif CfgDisplay is Not "">
<cfset CfgDisplay = "Use with: &nbsp;" & CfgDisplay>
<cfset LineCtr = LineCtr + 1>
<cfset Me.Parts.AddItem= CfgDisplay>
</cfif>

From: "JR "Bob" Dobbs" on
Add it as a column in your queries.

Two recommendations.
1. Use cfqueryparam for all parameters in your cfquery tags.
2. I can't give specifics having seen only snippets of your code, but consider
consolidating your queries to make fewer calls to your database if possible.

<cfif #Recordset1.WheelBase# GT 0>
<cfquery name="rsWheel" datasource="Aces">
Select WheelBase,
<cfqueryparam value="#Trim(rsWheel.WheelBase)# WheelBase"
cfsqltype="cf_sql_varchar" /> AS CfgDisplay
From WheelBase
Where WheelBaseID = #Recordset1.WheelBase#
</cfquery>
<!--- <cfset CfgDisplay = CfgDisplay & "#Trim(rsWheel.WheelBase)#
WheelBase &nbsp; "> --->
</cfif>
<cfif #Recordset1.TransmissionBase# GT 0>
<cfquery name="rsTranBase" datasource="Aces">
Select [TransmissionType]![TransmissionTypeName]
[TransmissionControlType]![TransmissionControlTypeName]
[TransmissionNumSpeeds]![TransmissionNumSpeeds] As Expr1,
TransmissionBase.TransmissionBaseID,
<cfqueryparam value="#Trim(rsTranBase.Expr1)# Transmission"
cfsqltype="cf_sql_varchar" /> AS CfgDisplay
From TransmissionNumSpeeds Inner Join (TransmissionControlType
INNER
Join (TransmissionType Inner Join TransmissionBase On
TransmissionType.TransmissionTypeID
= TransmissionBase.TransmissionTypeID) ON
TransmissionControlType.TransmissionControlTypeID
= TransmissionBase.TransmissionControlTypeID) ON
TransmissionNumSpeeds.TransmissionNumSpeeds
= TransmissionBase.TransmissionNumSpeedsID
</cfquery>
<!--- <cfset CfgDisplay = CfgDisplay & "#Trim(rsTranBase.Expr1)#
Transmission &nbsp; "> --->
</cfif>
<cfif CfgDisplay is Not "">
<cfset CfgDisplay = "Use with: &nbsp;" & CfgDisplay>
<cfset LineCtr = LineCtr + 1>
<cfset Me.Parts.AddItem= CfgDisplay>
</cfif>

From: "JR "Bob" Dobbs" on
[q][i]Originally posted by: [b][b]mactech999[/b][/b][/i]
can i use AS CfgDisplay more than once in one query?[/q]

If your database allows it. Give it a try.



First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4
Prev: Cf 8 / onRequestEnd / html cfgrid
Next: Help with CFWINDOW