Solved

Old Pro needs to learn new tricks

Posted on 2002-06-24
6
108 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 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

11 Experts available now in Live!

Get 1:1 Help Now