Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Old Pro needs to learn new tricks

Posted on 2002-06-24
6
Medium Priority
?
115 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 200 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

664 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