Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Old Pro needs to learn new tricks

Posted on 2002-06-24
6
111 Views
Last Modified: 2013-12-24
Hi to all. Working my way through CF and need some help. I have a SQL statement and I will give you the last three lines.

AND a.pointname = '#strPointName#'
AND a.rec_time_str >= '#dtFormatDate#'
AND a.rec_time_str < '#dtFormatDatePlus1#'

You can easly see my Question .. .. CF doesn't like the '<' in my string. What do I use? I would like to give you hunderds of points, but I will save them for the REAL hard questions.
regards
0
Comment
Question by:vbDoc
  • 3
  • 3
6 Comments
 
LVL 5

Accepted Solution

by:
Yog earned 50 total points
ID: 7105440
within a cfquery, this is valid. are you trying to put a string within cfquery , ie like
<cfquery>
#strQuery#
</cfquery
if thats the case use #preservesinglequotes(strQuery)#
0
 
LVL 2

Author Comment

by:vbDoc
ID: 7105515
Ok .. .. here is the full Query.

<CFQUERY name="InsertIntoPre" Dtasource="#Application.DSN#">

INSERT INTO pre_avg_data(pointname, red_method, rate, date_changed, value)
SELECT a.pointname, a.red_method, a.rate,
a.rec_time_str, c.value_final
FROM trend_data_master a, trend_data_values c
WHERE a.trend_data_master_uid = c.trend_data_master_uid
AND a.pointname = '#strPointName#'
AND a.rec_time_str >= '#dtFormatDate#'
AND a.rec_time_str < '#dtFormatDatePlus1#'

</CFQUERY>

When I take out the '<' and replace it with '=' then CF is happy.
0
 
LVL 5

Expert Comment

by:Yog
ID: 7105863
try

<CFQUERY name="InsertIntoPre" Dtasource="#Application.DSN#">

INSERT INTO pre_avg_data(pointname, red_method, rate, date_changed, value)
SELECT a.pointname, a.red_method, a.rate,
a.rec_time_str, c.value_final
FROM trend_data_master a, trend_data_values c
WHERE a.trend_data_master_uid = c.trend_data_master_uid
AND a.pointname = '#strPointName#'
AND a.rec_time_str >= '#createodbcdate(dtFormatDate)#'
AND a.rec_time_str < '#createodbcdate(dtFormatDatePlus1)#'

</CFQUERY>

either use createodbcdate or createodbcdatetime, should be a date formatting problem
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 2

Author Comment

by:vbDoc
ID: 7105884
Yoq, I figured out the problem. It's CF Studio trying to think for me. The code is correct and it runs. Points are yours for your time.

John
0
 
LVL 5

Expert Comment

by:Yog
ID: 7107564
John,

 thanks for the points, what was the problem, anything with cfstudio..

cheers.
yog
0
 
LVL 2

Author Comment

by:vbDoc
ID: 7107750
Your welcome .. ..
cfstudio didn't like the '<' in the SQL statement.
John
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question