Hi,
Could someone help to anwser this question. Is it possible to have a <cfif #variable# like '%test%'> in a cfquery select statement? I tried the following but a no go.
<cfquery name="get_tagname_3" datasource="#source#">
<cfif #variable# like '%test%'>
select top 1 name
<cfelse>
select top 1 max(datetime) as datetime, value
</cfif>
from analoghistory
where tagname = '#get_tags.tagname#'
and datetime > #shift_marker_time_1#
and datetime < #dateadd("n", 480, shift_marker_time_1)#
and wwretrievalmode = 'delta'
and value is not null and value != 0
group by value
order by datetime desc
</cfquery>
Could someone help to anwser this question. Is it possible to have a <cfif #variable# like '%test%'> in a cfquery select statement? I tried the following but a no go.
<cfquery name="get_tagname_3" datasource="#source#">
<cfif #variable# like '%test%'>
select top 1 name
<cfelse>
select top 1 max(datetime) as datetime, value
</cfif>
from analoghistory
where tagname = '#get_tags.tagname#'
and datetime > #shift_marker_time_1#
and datetime < #dateadd("n", 480, shift_marker_time_1)#
and wwretrievalmode = 'delta'
and value is not null and value != 0
group by value
order by datetime desc
</cfquery>