Solved

Old Pro needs to learn new tricks

Posted on 2002-06-24
6
109 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
OpenLDAP set password to expire 7 526
Redirect website ! 4 52
Apached AXIS end to end simple good example 2 84
Redundant SQL Servers Without Clustering 7 92
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

929 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now