I'm noticing some oddities I'm not that familiar with. To outline, I test at home on cfmx but one of our work servers is still running on 5, hence these results.
Perhaps someone can shed some light on this for me. If I conduct a query of a query, like so...
<cfquery datasource="#request.dsn#" name="election_contested">
SELECT
contested_ID,mayoralty,src_waikaka,src_gore
FROM
election_contested
</cfquery>
<cfquery dbtype="query" name="election_mayoralty">
SELECT mayoralty
FROM election_contested
WHERE mayoralty IS NOT NULL
</cfquery>
CFMX is fine with this but cf5 throws an operator error and barfs on the "IS NOT NULL" (but only for a query on a query). I can use "is not null" on a normal database query in CF5.
Whereas if I try this alternate approach...
<cfquery dbtype="query" name="election_mayoralty">
SELECT mayoralty
FROM election_contested
WHERE mayoralty <> ''
</cfquery>
CF5 is fine with this and CFMX reads it ok but disregards the where command (or at least, it's ignoring it) and thus displays the empty fields as well.
The only way I know how to make this work across both systems is to remove the where command from the query completely and in the output use something like
<h3>District Council Mayoralty</h3>
<cfoutput query="election_mayoralty">
<cfif Len(mayoralty)>
#capFirstTitle(mayoralty)#<br />
</cfif>
</cfoutput>
Has anyone seen this type of thing before, and is it possible for me to use something in the second query to remove null entries (that works on 5 and MX)?
TIA
Regards
MarkH
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
- RE: SQl on CF5 Versus CFMX Mark Henderson
- RE: SQl on CF5 Versus CFMX Matthew Walker