Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cfif "LIKE" in cfquery statement 1

Status
Not open for further replies.

alsjka

Technical User
Jan 21, 2003
114
US
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>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top