You need to use a function to convert the stored date value into something that you can compare. The 'like' doesn't work, because your date is not stored as a string.
In Oracle, the SQL would look something like this:
select * from table1
where to_char(mydate, 'mm/dd/yyyy') = '12/04/2002'...
We do something like this:
<cftry>
<cfquery name="avail" datasource="DSN">
SELECT 1 FROM DUAL
</cfquery>
<cfcatch type="database">
do something because we didn't connect
</cfcatch>
</cftry>
It works very nicely.
You need to escape your quotes when you put the data in the database. The SQL processor is choking on them, thinking you've reached the end of the string.
I wonder if the problem is that the mail server doesn't support the post method. Try method="get", which will put your form fields on the URL string as URL variables instead.
The other thing I would investigate is cutting your mail message, pasting it intact into a blank page, save...
In order to use a database in CF, you need to build a datasource for it. The datasource is a connection that is describe through the CF administrator. It sounds to me like either you ahve not done this, or the connection is not correct. If you have access to the CF Administrator, you should...
I don't know exactly what you mean by "find out". You can set a variable inside the IF block with a different value for each version of the query and display it. Or Log it, I guess. If debugging is turned on, you can view the SQL statements at the bottom of the page. Other than...
In your href, include the record number of your entry. You don't give the name of your query, but the record number is stored in <queryname>.CurrentRow. Let's say the query is called BOOKS, then the reference would be:
<A href="grfakta_intro.cfm?record=#BOOKS.CurrentRow#">
Now when...
Try building up the where clause:
<cfset matchfield = "%" & form.SUBJECT & "%">
<CFQUERY NAME="GETCAT" DATASOURCE="GLKB">
SELECT *
FROM KnowledgeBase
WHERE subject like '#matchField#'
</CFQUERY>
Assuming that the textarea is named field, the following snippet will print out each name on a separate line.
<cfoutput>
<cfloop list="#form.field#" index="value" delimiters="#chr(10)#">
#value# <br>
</cfloop>
</cfoutput>
Since we're able to get...
If you are using the Verity Spider indexing feature of CF 5 and Verity K2, then there is an option "-skip" taht will skip certain text within certain tags when indexing the documents.
A more general approach will also work. The Replace function can be used to replace any substring in a string with any other substring. In our case, you would replace the '$' with the null string:
<cfset newValue = Replace( value, "$", "", "ALL" )>
You don't...
I agree with a440guy that a structure is a better fit to you problem than an array.
Is it essential that you "log out" a user when he closes his browser? Or could you do something with timeout instead? We use a technique where after a certain amount of time, the user has to log back...
misereatur (Programmer) Jan 3, 2002 writes:
How do I write a query that will do the following:
Select * from Table where FieldA = #Var1# or #Var2# or #Var3#
to which I respond:
Select * from Table
where Field1 IN (#var1#,#var2#,#var3#)
There is a CF_CAPITALIZE custom tag on the Allaire Developer's forum that will do things like change MIKE SHORT to Mike Short. Now if there would be one that could fix my speling mistakjes. :-)
Here's a way that will work in CF 5:
<!--- Select some stuff to display randomly
ORDER BY is just there to prove it works
--->
<cfquery name="test" datasource="#Variables.Datasource#">
SELECT LAST_NAME
FROM PERSON
WHERE SSN like ('000%')
ORDER BY...
If the five buttons are links, then there is a CGI variable named CGI.HTTP_REFERER that contains the URL of the page from which you linked. If you need to trace this as the visitor travels throughout your site, then save it as a Session variable.
However, this won't work if your pages are in...
I wonder if the minus signs in the UUID are causing trouble. Try this:
<cfoutput>
<cfset uuid = '#URL.UUID#'>
</cfoutput>
-- or --
<cfoutput>
<cfset temp = SetVariable( uuid, '#URL.UUID#'>
</cfoutput>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.