RE: StructFindValue Question...
Che, >Dan, unfortunately, I gave a stripped down example. The main query is more >complex (has 10 or so columns w/multiple WHERE clauses) and would not work >well with a Q of Q as dynamic values are passed to it. Any other ideas? The complexity of the original query doesn't really matter. The QoQ functionality allows you to take a query object and then break that query down farther by using T-SQL based statements. If your original query was named "queryName", the original code I posted (which is below) would do exactly what you wanted to do w/the StructFind() function. > >select >count(OptNurseryOnly) >from >queryName >where >OptNurseryOnly = 1 > -Dan ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256101 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: StructFindValue Question...
How about You have ones On 10/9/06, Che Vilnonis <[EMAIL PROTECTED]> wrote: > Hmmm. I'm just trying to use what code has the least amount of overhead. > Perhaps I would be better just using the ValueList function instead of Q of > Q? > > Thanks, Che > > -Original Message- > From: Ben Nadel [mailto:[EMAIL PROTECTED] > Sent: Monday, October 09, 2006 5:20 PM > To: CF-Talk > Subject: RE: StructFindValue Question... > > > I agree with Dan... No matter how complex the query is, query of queries > should be able to handle it. I doubt any sort of StructFind type thing would > be more powerful than a query of queries. > > Maybe if you gave us more info, we could help you construct your query of > queries. > > > ... > Ben Nadel > Certified Advanced ColdFusion Developer > www.bennadel.com > > > -Original Message- > From: Che Vilnonis [mailto:[EMAIL PROTECTED] > Sent: Monday, October 09, 2006 5:14 PM > To: CF-Talk > Subject: RE: StructFindValue Question... > > Dan, unfortunately, I gave a stripped down example. The main query is more > complex (has 10 or so columns w/multiple WHERE clauses) and would not work > well with a Q of Q as dynamic values are passed to it. Any other ideas? > > -Original Message----- > From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED] > Sent: Monday, October 09, 2006 5:11 PM > To: CF-Talk > Subject: RE: StructFindValue Question... > > > Che, > > You can use Queries-of-Queries: > > > select > count(OptNurseryOnly) > from > queryName > where > OptNurseryOnly = 1 > > > That would give you the count of the number of entries that had > OptNurseryOnly set to 1. (NOTE: If the OptNurseryOnly is a text field, > you'll want to use apostrophes around the value.) > > -Dan > > >-Original Message- > >From: Che Vilnonis [mailto:[EMAIL PROTECTED] > >Sent: Monday, October 09, 2006 5:05 PM > >To: CF-Talk > >Subject: StructFindValue Question... > > > >I *think* I need to use StructFindValue here. Not sure. > > > >I have a simple query. One of the columns is named OptNurseryOnly. The > >values returned from the db can only be a one or a zero. I'd like to > >use some type of conditional logic to know if any "1"s are returned in > >the query *w/o looping through the query or using a valuelist funtion* > >but I cannot quite get it to work. Something like: > > > > > > do something > > > > > >What am I doing wrong? > > > >~Che > > > > > > > > > > > > > > ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256093 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: StructFindValue Question...
How many records are typically returned by the query? On 10/9/06, Che Vilnonis <[EMAIL PROTECTED]> wrote: > > Hmmm. I'm just trying to use what code has the least amount of overhead. > Perhaps I would be better just using the ValueList function instead of Q > of > Q? > > Thanks, Che > > -Original Message- > From: Ben Nadel [mailto:[EMAIL PROTECTED] > Sent: Monday, October 09, 2006 5:20 PM > To: CF-Talk > Subject: RE: StructFindValue Question... > > > I agree with Dan... No matter how complex the query is, query of queries > should be able to handle it. I doubt any sort of StructFind type thing > would > be more powerful than a query of queries. > > Maybe if you gave us more info, we could help you construct your query of > queries. > > > ... > Ben Nadel > Certified Advanced ColdFusion Developer > www.bennadel.com > > > -Original Message- > From: Che Vilnonis [mailto:[EMAIL PROTECTED] > Sent: Monday, October 09, 2006 5:14 PM > To: CF-Talk > Subject: RE: StructFindValue Question... > > Dan, unfortunately, I gave a stripped down example. The main query is more > complex (has 10 or so columns w/multiple WHERE clauses) and would not work > well with a Q of Q as dynamic values are passed to it. Any other ideas? > > -Original Message- > From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED] > Sent: Monday, October 09, 2006 5:11 PM > To: CF-Talk > Subject: RE: StructFindValue Question... > > > Che, > > You can use Queries-of-Queries: > > > select > count(OptNurseryOnly) > from > queryName > where > OptNurseryOnly = 1 > > > That would give you the count of the number of entries that had > OptNurseryOnly set to 1. (NOTE: If the OptNurseryOnly is a text field, > you'll want to use apostrophes around the value.) > > -Dan > > >-Original Message- > >From: Che Vilnonis [mailto:[EMAIL PROTECTED] > >Sent: Monday, October 09, 2006 5:05 PM > >To: CF-Talk > >Subject: StructFindValue Question... > > > >I *think* I need to use StructFindValue here. Not sure. > > > >I have a simple query. One of the columns is named OptNurseryOnly. The > >values returned from the db can only be a one or a zero. I'd like to > >use some type of conditional logic to know if any "1"s are returned in > >the query *w/o looping through the query or using a valuelist funtion* > >but I cannot quite get it to work. Something like: > > > > > > do something > > > > > >What am I doing wrong? > > > >~Che > > > > > > > > > > > > > > ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256032 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: StructFindValue Question...
Hmmm. I'm just trying to use what code has the least amount of overhead. Perhaps I would be better just using the ValueList function instead of Q of Q? Thanks, Che -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:20 PM To: CF-Talk Subject: RE: StructFindValue Question... I agree with Dan... No matter how complex the query is, query of queries should be able to handle it. I doubt any sort of StructFind type thing would be more powerful than a query of queries. Maybe if you gave us more info, we could help you construct your query of queries. ... Ben Nadel Certified Advanced ColdFusion Developer www.bennadel.com -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:14 PM To: CF-Talk Subject: RE: StructFindValue Question... Dan, unfortunately, I gave a stripped down example. The main query is more complex (has 10 or so columns w/multiple WHERE clauses) and would not work well with a Q of Q as dynamic values are passed to it. Any other ideas? -Original Message- From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:11 PM To: CF-Talk Subject: RE: StructFindValue Question... Che, You can use Queries-of-Queries: select count(OptNurseryOnly) from queryName where OptNurseryOnly = 1 That would give you the count of the number of entries that had OptNurseryOnly set to 1. (NOTE: If the OptNurseryOnly is a text field, you'll want to use apostrophes around the value.) -Dan >-Original Message- >From: Che Vilnonis [mailto:[EMAIL PROTECTED] >Sent: Monday, October 09, 2006 5:05 PM >To: CF-Talk >Subject: StructFindValue Question... > >I *think* I need to use StructFindValue here. Not sure. > >I have a simple query. One of the columns is named OptNurseryOnly. The >values returned from the db can only be a one or a zero. I'd like to >use some type of conditional logic to know if any "1"s are returned in >the query *w/o looping through the query or using a valuelist funtion* >but I cannot quite get it to work. Something like: > > > do something > > >What am I doing wrong? > >~Che > > > ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256030 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: StructFindValue Question...
I agree with Dan... No matter how complex the query is, query of queries should be able to handle it. I doubt any sort of StructFind type thing would be more powerful than a query of queries. Maybe if you gave us more info, we could help you construct your query of queries. .. Ben Nadel Certified Advanced ColdFusion Developer www.bennadel.com -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:14 PM To: CF-Talk Subject: RE: StructFindValue Question... Dan, unfortunately, I gave a stripped down example. The main query is more complex (has 10 or so columns w/multiple WHERE clauses) and would not work well with a Q of Q as dynamic values are passed to it. Any other ideas? -Original Message- From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:11 PM To: CF-Talk Subject: RE: StructFindValue Question... Che, You can use Queries-of-Queries: select count(OptNurseryOnly) from queryName where OptNurseryOnly = 1 That would give you the count of the number of entries that had OptNurseryOnly set to 1. (NOTE: If the OptNurseryOnly is a text field, you'll want to use apostrophes around the value.) -Dan >-Original Message- >From: Che Vilnonis [mailto:[EMAIL PROTECTED] >Sent: Monday, October 09, 2006 5:05 PM >To: CF-Talk >Subject: StructFindValue Question... > >I *think* I need to use StructFindValue here. Not sure. > >I have a simple query. One of the columns is named OptNurseryOnly. The >values returned from the db can only be a one or a zero. I'd like to >use some type of conditional logic to know if any "1"s are returned in >the query *w/o looping through the query or using a valuelist funtion* >but I cannot quite get it to work. Something like: > > > do something > > >What am I doing wrong? > >~Che > > > ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256029 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: StructFindValue Question...
Dan, unfortunately, I gave a stripped down example. The main query is more complex (has 10 or so columns w/multiple WHERE clauses) and would not work well with a Q of Q as dynamic values are passed to it. Any other ideas? -Original Message- From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 5:11 PM To: CF-Talk Subject: RE: StructFindValue Question... Che, You can use Queries-of-Queries: select count(OptNurseryOnly) from queryName where OptNurseryOnly = 1 That would give you the count of the number of entries that had OptNurseryOnly set to 1. (NOTE: If the OptNurseryOnly is a text field, you'll want to use apostrophes around the value.) -Dan >-Original Message- >From: Che Vilnonis [mailto:[EMAIL PROTECTED] >Sent: Monday, October 09, 2006 5:05 PM >To: CF-Talk >Subject: StructFindValue Question... > >I *think* I need to use StructFindValue here. Not sure. > >I have a simple query. One of the columns is named OptNurseryOnly. The >values returned from the db can only be a one or a zero. I'd like to >use some type of conditional logic to know if any "1"s are returned in >the query *w/o looping through the query or using a valuelist funtion* >but I cannot quite get it to work. Something like: > > > do something > > >What am I doing wrong? > >~Che > > > ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256028 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: StructFindValue Question...
Che, You can use Queries-of-Queries: select count(OptNurseryOnly) from queryName where OptNurseryOnly = 1 That would give you the count of the number of entries that had OptNurseryOnly set to 1. (NOTE: If the OptNurseryOnly is a text field, you'll want to use apostrophes around the value.) -Dan >-Original Message- >From: Che Vilnonis [mailto:[EMAIL PROTECTED] >Sent: Monday, October 09, 2006 5:05 PM >To: CF-Talk >Subject: StructFindValue Question... > >I *think* I need to use StructFindValue here. Not sure. > >I have a simple query. One of the columns is named OptNurseryOnly. The >values returned from the db can only be a one or a zero. I'd like to use >some type of conditional logic to know if any "1"s are returned in the >query >*w/o looping through the query or using a valuelist funtion* but I cannot >quite get it to work. Something like: > > > do something > > >What am I doing wrong? > >~Che > > > ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256027 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4