Re: Outputting a hash character in an IIF() function.
On Wednesday 09 Jan 2008, Ian Skinner wrote: I'm having trouble with this and the usual tricks don't seem to be working. #iif(bgFlag,DE(' style=background-color: #DDFFDD'),DE(''))# Why not just rewrite it so as not to use iif or de ? -- Tom Chiverton Helping to administratively architect scalable CEOs on: http://thefalken.livejournal.com This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by The Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.com. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296241 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Outputting a hash character in an IIF() function.
I'm having trouble with this and the usual tricks don't seem to be working. #iif(bgFlag,DE(' style=background-color: #DDFFDD'),DE(''))# This fails. I have tried escaping the internal hash character by doubling. I have tried to concatenate chr(35). Everything I do throws exceptions involving invalidly paired hash characters. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296238 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Outputting a hash character in an IIF() function.
Have you tried assigning it to a variable in a cfset and then displaying the variable. Alternately, convert to RGB: style=background-color:rgb(221 255 221)' -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 09, 2008 9:34 AM To: CF-Talk Subject: Outputting a hash character in an IIF() function. I'm having trouble with this and the usual tricks don't seem to be working. #iif(bgFlag,DE(' style=background-color: #DDFFDD'),DE(''))# This fails. I have tried escaping the internal hash character by doubling. I have tried to concatenate chr(35). Everything I do throws exceptions involving invalidly paired hash characters. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296253 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Outputting a hash character in an IIF() function.
Tom Chiverton wrote: On Wednesday 09 Jan 2008, Ian Skinner wrote: I'm having trouble with this and the usual tricks don't seem to be working. #iif(bgFlag,DE(' style=background-color: #DDFFDD'),DE(''))# Why not just rewrite it so as not to use iif or de ? Generally because I prefer to KNOW why I have to replace one clear line of code with 5 lines of slightly less clear code that requires the using a few bits more memory to store a variable I will not use any place else. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296255 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Outputting a hash character in an IIF() function.
Dave wrote: Have you tried assigning it to a variable in a cfset and then displaying the variable. Alternately, convert to RGB: style=background-color:rgb(221 255 221)' Yes I can set and use a variable, but I was curious why I would have to do this. Why do I need to create five lines to set a variable and use a few bits more memory rather then use one clear function at the point where the decision needs to be made. The RGB solution is a good one. But I am still curious why one can not apparently output a hash mark in this manner. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296256 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Outputting a hash character in an IIF() function.
On Wednesday 09 Jan 2008, Ian Skinner wrote: Generally because I prefer to KNOW why I have to replace one clear line of code with 5 lines of slightly less clear code that requires the using a few bits more memory to store a variable I will not use any place else. if (foo){ bar=a }else{ bar=b } b seems clearer to me than nested iif and de. -- Tom Chiverton Helping to revolutionarily orchestrate B2B experiences on: http://thefalken.livejournal.com This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by The Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.com. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296257 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Outputting a hash character in an IIF() function.
The hash simply needs to be escaped as #iif(bgFlag,DE(' style=background-color: DDFFDD'),DE(''))# The hash needs to be escaped twice since you are delaying evaluation. The text: style=background-color: DDFFDD Is passed out of the de function as (including the quotes): style=background-color: ##DDFFDD That text is then evaluated by the iif to: style=background-color: #DDFFDD ~Brad -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 09, 2008 10:14 AM To: CF-Talk Subject: Re: Outputting a hash character in an IIF() function. Dave wrote: Have you tried assigning it to a variable in a cfset and then displaying the variable. Alternately, convert to RGB: style=background-color:rgb(221 255 221)' Yes I can set and use a variable, but I was curious why I would have to do this. Why do I need to create five lines to set a variable and use a few bits more memory rather then use one clear function at the point where the decision needs to be made. The RGB solution is a good one. But I am still curious why one can not apparently output a hash mark in this manner. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296258 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Outputting a hash character in an IIF() function.
Actually, if I am going to use braces, I like them to align vertically for better readability: if (foo) { bar = a; } else { bar = b; } But enough of this. He didn't ask for our opinions in code readability, he asked how to escape a hash mark in an iif. (which I answered in my previous reply. ~Brad ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296259 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Outputting a hash character in an IIF() function.
Brad Wood wrote: The hash simply needs to be escaped as #iif(bgFlag,DE(' style=background-color: DDFFDD'),DE(''))# The hash needs to be escaped twice since you are delaying evaluation. The text: style=background-color: DDFFDD Is passed out of the de function as (including the quotes): style=background-color: ##DDFFDD That text is then evaluated by the iif to: style=background-color: #DDFFDD ~Brad Thanks, now I understand what is going on. I had tried three, but never took it to four. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296260 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Outputting a hash character in an IIF() function.
Tom Chiverton wrote: if (foo){ bar=a }else{ bar=b } b seems clearer to me than nested iif and de. This is completely personal preference and a very very small matter. But I generally find less to be clearer then more. -- cfscript if (foo) { bar='a'; } else { bar='b'; } /cfscript use_number #bar# - 7 lines VERSUS - use_number #iif(foo,DE('a'),DE('b'))# - 1 line. But each to his own. I still wanted to know WHY it was not working and now I do. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296262 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Outputting a hash character in an IIF() function.
cfscriptif (foo) {bar='a';} else {bar='b';}/cfscriptuse_number #bar# Now it's one line... who didn't see that coming? :-P ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296272 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: The IIf function
It used to be, but is not so anymore, that IIF() was slower than cfifcfelse/cfif. It also used to be true, although I don't think it is any more, that all of the expressions in an IIF() are evaluated even if not used. Not true of cfif. I know in older versions this would cause an error: #iif(isDefined(myVar),myVar,'undefined'))# However, this wouldn't: cfif isDefined(myVar) #myVar# cfelse undefined /cfif Yeah, I thought it was pretty goofy too. I only ever really use iif() in situations like this: select name=chosenOption cfloop query=qOptions option value=#qOptions.option_id# #iif(qOptions.option_id eq variables.default_option_id,'selected','')##qOptions.option_name#/ option /cfloop /select I think it's very bad style to put CF tags inside HTML tags. -Original Message- From: Matthew Chambers [mailto:[EMAIL PROTECTED] Sent: Monday, May 01, 2006 7:40 PM To: CF-Talk Subject: The IIf function Hi all, Am I correct in saying that the IIf function and the cfif tag work differently on the following scenerio. In the CFIF tag, when the CFIF fails it will jump over the code which follows until a CFELSEIF, CFELSE or CFIF. Here's an example: -- CFIF The cfif failed so this text is not run. More to the point this code is not run, cfqueryKILL DATABASE/cfquery /CFIF --- Where as with the IIf function, CF will still test that the code for both the true and false cases will work? This is dumb, because the whole point for an IF is to check that you will have everything you need to run the code when it returns true. :::CFIF eg::: cfif IsDefined(foo cfset foo = foo+1 /cfif :::IIf eg::: Iif(IsDefined(foo),DE(foo=foo+1),DE('whatever')) Any thoughts? Cheers ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:239234 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
The IIf function
Hi all, Am I correct in saying that the IIf function and the cfif tag work differently on the following scenerio. In the CFIF tag, when the CFIF fails it will jump over the code which follows until a CFELSEIF, CFELSE or CFIF. Here's an example: -- CFIF The cfif failed so this text is not run. More to the point this code is not run, cfqueryKILL DATABASE/cfquery /CFIF --- Where as with the IIf function, CF will still test that the code for both the true and false cases will work? This is dumb, because the whole point for an IF is to check that you will have everything you need to run the code when it returns true. :::CFIF eg::: cfif IsDefined(foo cfset foo = foo+1 /cfif :::IIf eg::: Iif(IsDefined(foo),DE(foo=foo+1),DE('whatever')) Any thoughts? Cheers ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:239205 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: The IIf function
IIF() is shorthand replacement for IF/THEN/ELSE. Other langs have IIF() too, eh? Thus cfif foo IS 5 foo is 5 cfelse foo is not 5 /cfif is equivalent to IIF(foo IS 5, 'foo is 5', 'foo is not 5') *note...mind the quotes! ' is double quote followed by single quote DK On 5/1/06, Matthew Chambers [EMAIL PROTECTED] wrote: Hi all, Am I correct in saying that the IIf function and the cfif tag work differently on the following scenerio. In the CFIF tag, when the CFIF fails it will jump over the code which follows until a CFELSEIF, CFELSE or CFIF. Here's an example: -- CFIF The cfif failed so this text is not run. More to the point this code is not run, cfqueryKILL DATABASE/cfquery /CFIF --- Where as with the IIf function, CF will still test that the code for both the true and false cases will work? This is dumb, because the whole point for an IF is to check that you will have everything you need to run the code when it returns true. :::CFIF eg::: cfif IsDefined(foo cfset foo = foo+1 /cfif :::IIf eg::: Iif(IsDefined(foo),DE(foo=foo+1),DE('whatever')) Any thoughts? Cheers ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:239217 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: OT - IIF function in Access
I think you've got the SUM and IIF nested the wrony way 'round - try SUM(IIF(site_date {d '2000-04-27'}, totalbirds, 0)) -Original Message- From: Deanna L. Schneider [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 04, 2000 10:07 PM To: [EMAIL PROTECTED] Subject: Re: OT - IIF function in Access Thanks, John, but that's not really the problem, I don't think. The query works if I use constants like this. cfquery name="pullcount" datasource="#dbvar#" SELECT IIF(10, sum(totalbirds), 0) AS weekbirds, IIF(10, sum(totalbirds), 0) AS monthbirds, IIF(10, sum(totalbirds), 0)AS yearbirds, site.per_id, person.fname, person.lname FROM sighting, site, person WHERE sighting.site_id = site.site_id AND site.per_id = person.per_id GROUP BY site.per_id, person.fname, person.lname /cfquery But if I try to throw a variable in thereit doesn't work. More thoughts? -d [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'IIF(site_date #4/27/2000# sum(totalbirds), 0)'. SQL = "SELECT IIF(site_date {d '2000-04-27'} sum(totalbirds), 0) AS weekbirds, IIF(10, sum(totalbirds), 0) AS monthbirds, IIF(10, sum(totalbirds), 0)AS yearbirds, site.per_id, person.fname, person.lname FROM sighting, site, person WHERE sighting.site_id = site.site_id AND site.per_id = person.per_id GROUP BY site.per_id, person.fname, person.lname" -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
OT - IIF function in Access
Hi folks, this is a bit OT, but I thought there might be a better way to do what's not working in CF anyway, so here it is: I have the following code: cfset week = #now()# - #createtimespan(7, 0, 0, 0)# cfset month = #now()# - #createtimespan(30, 0, 0, 0)# cfset year = #now()# - #createtimespan(365, 0, 0, 0)# cfquery name="pullcount" datasource="#dbvar#" SELECT SUM(totalbirds) AS weekbirds, site.per_id, person.fname, person.lname FROM sighting, site, person WHERE sighting.site_id = site.site_id AND site.per_id = person.per_id AND site.site_date between #now()# AND #createodbcdate(month)# GROUP BY site.per_id, person.fname, person.lname /cfquery It works fine, but what I want to do is pull the bird counts for the week, the month and the year. I think I should be able to do it with something like: cfquery name="pullcount" datasource="#dbvar#" SELECT IIF(site.site_date between #now()# AND #createodbcdate(month)#, SUM(totalbirds) AS monthbirds, 0), site.per_id, person.fname, person.lname FROM sighting, site, person WHERE sighting.site_id = site.site_id AND site.per_id = person.per_id AND GROUP BY site.per_id, person.fname, person.lname /cfquery But, what I get is this lovely error: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'IIF(site.site_date between #5/4/2000 14:04:35# AND #4/4/2000#, SUM(totalbirds) AS monthbirds, 0)'. Help? TIA, Deanna Deanna Schneider Interactive Media Developer UWEX Cooperative Extension Electronic Publishing Group 103 Extension Bldg 432 N. Lake Street Madison, WI 53706 (608) 265-7923 -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: OT - IIF function in Access
I usually see the query coded as: AND site_date #date1# AND site_date #now()# Primitive I know, but tried and true :-) -Original Message- From: Deanna L. Schneider [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Thursday, May 04, 2000 3:10 PM Subject: OT - IIF function in Access Hi folks, this is a bit OT, but I thought there might be a better way to do what's not working in CF anyway, so here it is: I have the following code: cfset week = #now()# - #createtimespan(7, 0, 0, 0)# cfset month = #now()# - #createtimespan(30, 0, 0, 0)# cfset year = #now()# - #createtimespan(365, 0, 0, 0)# cfquery name="pullcount" datasource="#dbvar#" SELECT SUM(totalbirds) AS weekbirds, site.per_id, person.fname, person.lname FROM sighting, site, person WHERE sighting.site_id = site.site_id AND site.per_id = person.per_id AND site.site_date between #now()# AND #createodbcdate(month)# GROUP BY site.per_id, person.fname, person.lname /cfquery It works fine, but what I want to do is pull the bird counts for the week, the month and the year. I think I should be able to do it with something like: cfquery name="pullcount" datasource="#dbvar#" SELECT IIF(site.site_date between #now()# AND #createodbcdate(month)#, SUM(totalbirds) AS monthbirds, 0), site.per_id, person.fname, person.lname FROM sighting, site, person WHERE sighting.site_id = site.site_id AND site.per_id = person.per_id AND GROUP BY site.per_id, person.fname, person.lname /cfquery But, what I get is this lovely error: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'IIF(site.site_date between #5/4/2000 14:04:35# AND #4/4/2000#, SUM(totalbirds) AS monthbirds, 0)'. Help? TIA, Deanna Deanna Schneider Interactive Media Developer UWEX Cooperative Extension Electronic Publishing Group 103 Extension Bldg 432 N. Lake Street Madison, WI 53706 (608) 265-7923 -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: OT - IIF function in Access
Thanks, John, but that's not really the problem, I don't think. The query works if I use constants like this. cfquery name="pullcount" datasource="#dbvar#" SELECT IIF(10, sum(totalbirds), 0) AS weekbirds, IIF(10, sum(totalbirds), 0) AS monthbirds, IIF(10, sum(totalbirds), 0)AS yearbirds, site.per_id, person.fname, person.lname FROM sighting, site, person WHERE sighting.site_id = site.site_id AND site.per_id = person.per_id GROUP BY site.per_id, person.fname, person.lname /cfquery But if I try to throw a variable in thereit doesn't work. More thoughts? -d [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'IIF(site_date #4/27/2000# sum(totalbirds), 0)'. SQL = "SELECT IIF(site_date {d '2000-04-27'} sum(totalbirds), 0) AS weekbirds, IIF(10, sum(totalbirds), 0) AS monthbirds, IIF(10, sum(totalbirds), 0)AS yearbirds, site.per_id, person.fname, person.lname FROM sighting, site, person WHERE sighting.site_id = site.site_id AND site.per_id = person.per_id GROUP BY site.per_id, person.fname, person.lname" Deanna Schneider Interactive Media Developer UWEX Cooperative Extension Electronic Publishing Group 103 Extension Bldg 432 N. Lake Street Madison, WI 53706 (608) 265-7923 -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: OT - IIF function in Access
Missing comma in this piece (right before sum(totalbirds). Change that and see what happens. SELECT IIF(site_date {d '2000-04-27'} sum(totalbirds), 0) AS weekbirds, IIF(10, sum(totalbirds), 0) AS monthbirds, IIF(10, sum(totalbirds), 0)AS yearbirds, site.per_id, person.fname, person.lname FROM sighting, site, person WHERE sighting.site_id = site.site_id AND site.per_id = person.per_id GROUP BY site.per_id, person.fname, person.lname - Original Message - From: Deanna L. Schneider [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 04, 2000 20:06 Subject: Re: OT - IIF function in Access Thanks, John, but that's not really the problem, I don't think. The query works if I use constants like this. cfquery name="pullcount" datasource="#dbvar#" SELECT IIF(10, sum(totalbirds), 0) AS weekbirds, IIF(10, sum(totalbirds), 0) AS monthbirds, IIF(10, sum(totalbirds), 0)AS yearbirds, site.per_id, person.fname, person.lname FROM sighting, site, person WHERE sighting.site_id = site.site_id AND site.per_id = person.per_id GROUP BY site.per_id, person.fname, person.lname /cfquery But if I try to throw a variable in thereit doesn't work. More thoughts? -d [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'IIF(site_date #4/27/2000# sum(totalbirds), 0)'. SQL = "SELECT IIF(site_date {d '2000-04-27'} sum(totalbirds), 0) AS weekbirds, IIF(10, sum(totalbirds), 0) AS monthbirds, IIF(10, sum(totalbirds), 0)AS yearbirds, site.per_id, person.fname, person.lname FROM sighting, site, person WHERE sighting.site_id = site.site_id AND site.per_id = person.per_id GROUP BY site.per_id, person.fname, person.lname" Deanna Schneider Interactive Media Developer UWEX Cooperative Extension Electronic Publishing Group 103 Extension Bldg 432 N. Lake Street Madison, WI 53706 (608) 265-7923 -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.