Solved

Old Pro needs to learn new tricks

Posted on 2002-06-24
6
114 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
[X]
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
  • 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
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

 
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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

623 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