|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
New User
Author: Mike Miessen
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101437
Very good, just the type of help I was looking for.
Is that an SQL thing or a cold fusion thing? I was wondering what the %
sign was for LOL.
You might want to plug that "%" back in, as Scott Brady mentioned.
Using his "WHERE Title LIKE '%dog%'" example, if you take out the
leading "%", the word "hotdog" wouldn't be returned, and I think you
would want it to. On your site, if I search for "grass" I get nothing,
but if I search for "blue", I get a number of results. See what I mean?
With the leading and trailing "%", i.e. WHERE Title LIKE '%dog%'
Hotdog, hotdogs, and dog and dogs would be returned
With just the trailing "%", i.e. WHERE Title LIKE 'dog%'
Dog and dogs would be returned, but not hotdog or hotdogs
With just the leading "%", i.e. WHERE Title LIKE '%dog'
Dog and hotdog would be returned, but not hotdogs or dogs
HTH,
~bgl
--> -----Original Message-----
--
--> Sent: Thursday, December 26, 2002 10:15 AM
--> To: CF-Talk
--> Subject: RE: New User
-->
--> I took out the leading % and I dropped the ?TITLE from the action on
the
--> process button and my query now works. Thanks to you guys :)
-->
--> -----Original Message-----
--
--> Sent: Thursday, December 26, 2002 12:07 PM
--> To: CF-Talk
--> Subject: Re: New User
-->
--> Take out the leading % and your query will work. With both % in
there
--> this
--> returns everything because to SQL, your string is like everything in
the
--> database.
-->
--> HTH,
--> Clint
-->
--> ----- Original Message -----
--> From: "Mike Miessen" <mdmiessen@indy.rr.com>
--> To: "CF-Talk" <cf-talk@houseoffusion.com>
--> Sent: Thursday, December 26, 2002 11:03 AM
--> Subject: New User
-->
-->
--> > I have been trying to do a search of a database. It is a very
small
--> > testing database and I wrote a search entry form with dream weaver
--> with
--> > one field. This field should search on the title field of the
--> database
--> > and return results that contain the entry. I am a raw newbie here
and
--> > contemplating beating my head against a wall on this. Well my
query
--> > does not seem to work. I get all the records returned every time
not
--> > just the ones that contain the search term.
--> >
--> > Here I was thinking this would be easy. Boy was I wrong! Here is
my
--> > code Can anyone tell me what I'm doing wrong? The path to the
--> search
--> > form is
--> >
--> > http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
--> >
--> >
--> >
--> > <cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
--> > password="YeaRight" debug="yes">
--> > <cfparam name="TITLE" default="null">
--> > SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
--> > </cfquery>
--> >
--> > <html>
--> > <head>
--> > <title>Query Results</title>
--> > <meta http-equiv="Content-Type" content="text/html;
--> charset=iso-8859-1">
--> > </head>
--> >
--> > <body>
--> > <cfoutput query="rsTitle">
--> > #rsTitle.Title#<br>
--> > </cfoutput>
--> >
--> > </body>
--> > </html>
--> >
--> >
-->
-->
Author: Rick Faircloth
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101408
Hi, Mike.
I'm new to mySQL also, and was having a problem inserting dates
into a db. Before using mySQL , I used <CFSET Form.Date =
#CreateODBCDate(Form.Date)#>
before inserting into the db. I would do that before the query to format
the date
for the db, regardless of how the user entered the date...2/2/2002 or 02 Feb
2002, or whatever.
However, this didn't work with mySQL.
I went to this statement to insert my date, whether it was for an insert
query or update query:
<cfqueryparam cfsqltype="CF_SQL_DATE"
Value=#DateFormat(CreateODBCDate(Form.Date), 'M/D/YYYY')#">
I didn't change the default date format for mySQL, and that format may work
for you. But if you change the
default format for your mySQL field, you may have to modify the 'M/D/YYYY'
date format to match.
HTH,
Rick
Rick Faircloth,
Prism Productions
Well I was thinking. Dangerous activity for me but here it is. Why
would the event_date be returning the default date. I assumed it would
return the date associated with the record being returned from the
search.
CFParam creates a default value for a CF variable (if the variable does
not
exist, it creates it and assigns that value). It has nothing to do with
the
data in the DB.
--Ben Doom
Programmer & General Lackey
Moonbow Software
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 2:03 PM
: To: CF-Talk
: Subject: RE: New User
:
:
: I tried
:
: <cfparam name="Event_Date" default="1/1/2002">
:
: both inside and just before the cfquery but it seems to make no
: difference.
:
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 1:52 PM
: To: CF-Talk
: Subject: RE: New User
:
: 1/1/1900 is the default date in MS SQL 2K (and, I assume, many other
: DBs).
: It sounds like you didn't set a default date when you created the
: column, so
: it's returning the system default.
:
:
:
: --Ben Doom
: Programmer & General Lackey
: Moonbow Software
:
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:34 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: :
: : OK that sounds reasonable I'll try that. Now I'm trying to add a
date
: : display field but it is returning the same date each time 01/01/1900
: and
: : I know that's not right :)
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:25 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: : You will need to put back in the leading % in case the word they are
: : searching for is in the middle of a title.
: :
: : Example
: :
: : Search string = "Time"
: :
: : Will return = "Time to go"
: :
: : Will not return = "It's Time to go."
: :
: : Also someone else mentioned using upper(), on the column and the
: search
: : string your looking for to get by the case sensitivity of the db, I
: : would recommend you doing it as well.
: :
: : Tim
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:15 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: :
: : I took out the leading % and I dropped the ?TITLE from the action on
: the
: : process button and my query now works. Thanks to you guys :)
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 12:07 PM
: : To: CF-Talk
: : Subject: Re: New User
: :
: : Take out the leading % and your query will work. With both % in
there
: : this
: : returns everything because to SQL, your string is like everything in
: the
: : database.
: :
: : HTH,
: : Clint
: :
: : ----- Original Message -----
: : From: "Mike Miessen" <mdmiessen@indy.rr.com>
: : To: "CF-Talk" <cf-talk@houseoffusion.com>
: : Sent: Thursday, December 26, 2002 11:03 AM
: : Subject: New User
: :
: :
: : > I have been trying to do a search of a database. It is a very
small
: : > testing database and I wrote a search entry form with dream weaver
: : with
: : > one field. This field should search on the title field of the
: : database
: : > and return results that contain the entry. I am a raw newbie here
: and
: : > contemplating beating my head against a wall on this. Well my
query
: : > does not seem to work. I get all the records returned every time
: not
: : > just the ones that contain the search term.
: : >
: : > Here I was thinking this would be easy. Boy was I wrong! Here is
: my
: : > code Can anyone tell me what I'm doing wrong? The path to the
: : search
: : > form is
: : >
: : > http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
: : >
: : >
: : >
: : > <cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
: : > password="YeaRight" debug="yes">
: : > <cfparam name="TITLE" default="null">
: : > SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
: : > </cfquery>
: : >
: : > <html>
: : > <head>
: : > <title>Query Results</title>
: : > <meta http-equiv="Content-Type" content="text/html;
: : charset=iso-8859-1">
: : > </head>
: : >
: : > <body>
: : > <cfoutput query="rsTitle">
: : > #rsTitle.Title#<br>
: : > </cfoutput>
: : >
: : > </body>
: : > </html>
: : >
: : >
: :
: :
: :
: :
:
:
Author: Jerry Johnson
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101402
The first thing you need to do is find out how the date field is defined in the
db.
It could be a TIMESTAMP, a DATE or a DATETIME. Each functions very differently.
You can use show to get the structure of the table:
SHOW FULL COLUMNS FROM tbl_name
this will let you see how the db is currently constructed.
(If you need the rest of the code to return the query and loop through the
results, let me know)
You are using Mysql. Are you also using the MyODBC driver?
I don't know the truth of the following statement, since I alsways set the date
fields myself, rather than defaulting, but this comment is on one of the miriad
mysql docs mirrors:
Joe <mysql@chesak.com>:
For clarity regarding default values, the following two sentences should be added
to this page...
Default values must be constants. This means you cannot set the default for a
date column to be the value of a function such as NOW() or CURRENT_DATE.
Unfortunately, this dashes my hopes of creating a table that automatically
generates both a date created and a date modified for each of its records... :(
Also, there was this note:
``Zero'' date or time values used through MyODBC are converted automatically to
NULL in MyODBC Version 2.50.12 and above, because ODBC can't handle such values.
So, if you can let me know what type the date column is, we can work from there.
Jerry
>>> mdmiessen@indy.rr.com 12/26/02 02:10PM >>>
We have mySQL database but I didn't set it up myself. I'll talk to
Kevin (My system guy) when he becomes available and maybe he can show me
how to do this. We are both learning.
Assuming you are using SQL 2K... Go into enterprise manager and go into
the
table design view.
click on your date field and then in the default value field, type
getdate(). Now save your table and your done.
HTH
Clint
----- Excess quoted text cut - see Original Post for more -----
date
----- Excess quoted text cut - see Original Post for more -----
there
----- Excess quoted text cut - see Original Post for more -----
small
----- Excess quoted text cut - see Original Post for more -----
query
----- Excess quoted text cut - see Original Post for more -----
Author: Ben Doom
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101395
What date associated with the record? The DB does not (as far as I know)
associate a creation or update datestamp with the data -- that's left up to
you if you want it. Any associated date is one you created.
Now, if you are creating and setting a datestamp to, say, yesterday, but
it's returning the system default, that's a whole 'nother story. But it
sounds like you were just assuming that the creation date of the record
would be accessible via a datetime field.
--Ben Doom
Programmer & General Lackey
Moonbow Software
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 2:44 PM
: To: CF-Talk
: Subject: RE: New User
:
:
: Well I was thinking. Dangerous activity for me but here it is. Why
: would the event_date be returning the default date. I assumed it would
: return the date associated with the record being returned from the
: search.
:
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 2:10 PM
: To: CF-Talk
: Subject: RE: New User
:
: CFParam creates a default value for a CF variable (if the variable does
: not
: exist, it creates it and assigns that value). It has nothing to do with
: the
: data in the DB.
:
:
:
:
:
: --Ben Doom
: Programmer & General Lackey
: Moonbow Software
:
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 2:03 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: :
: : I tried
: :
: : <cfparam name="Event_Date" default="1/1/2002">
: :
: : both inside and just before the cfquery but it seems to make no
: : difference.
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:52 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: : 1/1/1900 is the default date in MS SQL 2K (and, I assume, many other
: : DBs).
: : It sounds like you didn't set a default date when you created the
: : column, so
: : it's returning the system default.
: :
: :
: :
: : --Ben Doom
: : Programmer & General Lackey
: : Moonbow Software
: :
: : : -----Original Message-----
: : :
: : : Sent: Thursday, December 26, 2002 1:34 PM
: : : To: CF-Talk
: : : Subject: RE: New User
: : :
: : :
: : : OK that sounds reasonable I'll try that. Now I'm trying to add a
: date
: : : display field but it is returning the same date each time 01/01/1900
: : and
: : : I know that's not right :)
: : :
: : : -----Original Message-----
: : :
: : : Sent: Thursday, December 26, 2002 1:25 PM
: : : To: CF-Talk
: : : Subject: RE: New User
: : :
: : : You will need to put back in the leading % in case the word they are
: : : searching for is in the middle of a title.
: : :
: : : Example
: : :
: : : Search string = "Time"
: : :
: : : Will return = "Time to go"
: : :
: : : Will not return = "It's Time to go."
: : :
: : : Also someone else mentioned using upper(), on the column and the
: : search
: : : string your looking for to get by the case sensitivity of the db, I
: : : would recommend you doing it as well.
: : :
: : : Tim
: : :
: : : -----Original Message-----
: : :
: : : Sent: Thursday, December 26, 2002 1:15 PM
: : : To: CF-Talk
: : : Subject: RE: New User
: : :
: : :
: : : I took out the leading % and I dropped the ?TITLE from the action on
: : the
: : : process button and my query now works. Thanks to you guys :)
: : :
: : : -----Original Message-----
: : :
: : : Sent: Thursday, December 26, 2002 12:07 PM
: : : To: CF-Talk
: : : Subject: Re: New User
: : :
: : : Take out the leading % and your query will work. With both % in
: there
: : : this
: : : returns everything because to SQL, your string is like everything in
: : the
: : : database.
: : :
: : : HTH,
: : : Clint
: : :
: : : ----- Original Message -----
: : : From: "Mike Miessen" <mdmiessen@indy.rr.com>
: : : To: "CF-Talk" <cf-talk@houseoffusion.com>
: : : Sent: Thursday, December 26, 2002 11:03 AM
: : : Subject: New User
: : :
: : :
: : : > I have been trying to do a search of a database. It is a very
: small
: : : > testing database and I wrote a search entry form with dream weaver
: : : with
: : : > one field. This field should search on the title field of the
: : : database
: : : > and return results that contain the entry. I am a raw newbie here
: : and
: : : > contemplating beating my head against a wall on this. Well my
: query
: : : > does not seem to work. I get all the records returned every time
: : not
: : : > just the ones that contain the search term.
: : : >
: : : > Here I was thinking this would be easy. Boy was I wrong! Here is
: : my
: : : > code Can anyone tell me what I'm doing wrong? The path to the
: : : search
: : : > form is
: : : >
: : : > http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
: : : >
: : : >
: : : >
: : : > <cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
: : : > password="YeaRight" debug="yes">
: : : > <cfparam name="TITLE" default="null">
: : : > SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
: : : > </cfquery>
: : : >
: : : > <html>
: : : > <head>
: : : > <title>Query Results</title>
: : : > <meta http-equiv="Content-Type" content="text/html;
: : : charset=iso-8859-1">
: : : > </head>
: : : >
: : : > <body>
: : : > <cfoutput query="rsTitle">
: : : > #rsTitle.Title#<br>
: : : > </cfoutput>
: : : >
: : : > </body>
: : : > </html>
: : : >
: : : >
: : :
: : :
: : :
: : :
: :
: :
:
:
Author: Mike Miessen
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101394
Well I was thinking. Dangerous activity for me but here it is. Why
would the event_date be returning the default date. I assumed it would
return the date associated with the record being returned from the
search.
CFParam creates a default value for a CF variable (if the variable does
not
exist, it creates it and assigns that value). It has nothing to do with
the
data in the DB.
--Ben Doom
Programmer & General Lackey
Moonbow Software
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 2:03 PM
: To: CF-Talk
: Subject: RE: New User
:
:
: I tried
:
: <cfparam name="Event_Date" default="1/1/2002">
:
: both inside and just before the cfquery but it seems to make no
: difference.
:
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 1:52 PM
: To: CF-Talk
: Subject: RE: New User
:
: 1/1/1900 is the default date in MS SQL 2K (and, I assume, many other
: DBs).
: It sounds like you didn't set a default date when you created the
: column, so
: it's returning the system default.
:
:
:
: --Ben Doom
: Programmer & General Lackey
: Moonbow Software
:
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:34 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: :
: : OK that sounds reasonable I'll try that. Now I'm trying to add a
date
: : display field but it is returning the same date each time 01/01/1900
: and
: : I know that's not right :)
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:25 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: : You will need to put back in the leading % in case the word they are
: : searching for is in the middle of a title.
: :
: : Example
: :
: : Search string = "Time"
: :
: : Will return = "Time to go"
: :
: : Will not return = "It's Time to go."
: :
: : Also someone else mentioned using upper(), on the column and the
: search
: : string your looking for to get by the case sensitivity of the db, I
: : would recommend you doing it as well.
: :
: : Tim
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:15 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: :
: : I took out the leading % and I dropped the ?TITLE from the action on
: the
: : process button and my query now works. Thanks to you guys :)
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 12:07 PM
: : To: CF-Talk
: : Subject: Re: New User
: :
: : Take out the leading % and your query will work. With both % in
there
: : this
: : returns everything because to SQL, your string is like everything in
: the
: : database.
: :
: : HTH,
: : Clint
: :
: : ----- Original Message -----
: : From: "Mike Miessen" <mdmiessen@indy.rr.com>
: : To: "CF-Talk" <cf-talk@houseoffusion.com>
: : Sent: Thursday, December 26, 2002 11:03 AM
: : Subject: New User
: :
: :
: : > I have been trying to do a search of a database. It is a very
small
: : > testing database and I wrote a search entry form with dream weaver
: : with
: : > one field. This field should search on the title field of the
: : database
: : > and return results that contain the entry. I am a raw newbie here
: and
: : > contemplating beating my head against a wall on this. Well my
query
: : > does not seem to work. I get all the records returned every time
: not
: : > just the ones that contain the search term.
: : >
: : > Here I was thinking this would be easy. Boy was I wrong! Here is
: my
: : > code Can anyone tell me what I'm doing wrong? The path to the
: : search
: : > form is
: : >
: : > http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
: : >
: : >
: : >
: : > <cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
: : > password="YeaRight" debug="yes">
: : > <cfparam name="TITLE" default="null">
: : > SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
: : > </cfquery>
: : >
: : > <html>
: : > <head>
: : > <title>Query Results</title>
: : > <meta http-equiv="Content-Type" content="text/html;
: : charset=iso-8859-1">
: : > </head>
: : >
: : > <body>
: : > <cfoutput query="rsTitle">
: : > #rsTitle.Title#<br>
: : > </cfoutput>
: : >
: : > </body>
: : > </html>
: : >
: : >
: :
: :
: :
: :
:
:
Author: Mike Miessen
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101388
Ok thanks. I'll check with Kevin on this (My system guy) he set up the
database and I guess I need to find out how he did it.
CFParam creates a default value for a CF variable (if the variable does
not
exist, it creates it and assigns that value). It has nothing to do with
the
data in the DB.
--Ben Doom
Programmer & General Lackey
Moonbow Software
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 2:03 PM
: To: CF-Talk
: Subject: RE: New User
:
:
: I tried
:
: <cfparam name="Event_Date" default="1/1/2002">
:
: both inside and just before the cfquery but it seems to make no
: difference.
:
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 1:52 PM
: To: CF-Talk
: Subject: RE: New User
:
: 1/1/1900 is the default date in MS SQL 2K (and, I assume, many other
: DBs).
: It sounds like you didn't set a default date when you created the
: column, so
: it's returning the system default.
:
:
:
: --Ben Doom
: Programmer & General Lackey
: Moonbow Software
:
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:34 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: :
: : OK that sounds reasonable I'll try that. Now I'm trying to add a
date
: : display field but it is returning the same date each time 01/01/1900
: and
: : I know that's not right :)
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:25 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: : You will need to put back in the leading % in case the word they are
: : searching for is in the middle of a title.
: :
: : Example
: :
: : Search string = "Time"
: :
: : Will return = "Time to go"
: :
: : Will not return = "It's Time to go."
: :
: : Also someone else mentioned using upper(), on the column and the
: search
: : string your looking for to get by the case sensitivity of the db, I
: : would recommend you doing it as well.
: :
: : Tim
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:15 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: :
: : I took out the leading % and I dropped the ?TITLE from the action on
: the
: : process button and my query now works. Thanks to you guys :)
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 12:07 PM
: : To: CF-Talk
: : Subject: Re: New User
: :
: : Take out the leading % and your query will work. With both % in
there
: : this
: : returns everything because to SQL, your string is like everything in
: the
: : database.
: :
: : HTH,
: : Clint
: :
: : ----- Original Message -----
: : From: "Mike Miessen" <mdmiessen@indy.rr.com>
: : To: "CF-Talk" <cf-talk@houseoffusion.com>
: : Sent: Thursday, December 26, 2002 11:03 AM
: : Subject: New User
: :
: :
: : > I have been trying to do a search of a database. It is a very
small
: : > testing database and I wrote a search entry form with dream weaver
: : with
: : > one field. This field should search on the title field of the
: : database
: : > and return results that contain the entry. I am a raw newbie here
: and
: : > contemplating beating my head against a wall on this. Well my
query
: : > does not seem to work. I get all the records returned every time
: not
: : > just the ones that contain the search term.
: : >
: : > Here I was thinking this would be easy. Boy was I wrong! Here is
: my
: : > code Can anyone tell me what I'm doing wrong? The path to the
: : search
: : > form is
: : >
: : > http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
: : >
: : >
: : >
: : > <cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
: : > password="YeaRight" debug="yes">
: : > <cfparam name="TITLE" default="null">
: : > SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
: : > </cfquery>
: : >
: : > <html>
: : > <head>
: : > <title>Query Results</title>
: : > <meta http-equiv="Content-Type" content="text/html;
: : charset=iso-8859-1">
: : > </head>
: : >
: : > <body>
: : > <cfoutput query="rsTitle">
: : > #rsTitle.Title#<br>
: : > </cfoutput>
: : >
: : > </body>
: : > </html>
: : >
: : >
: :
: :
: :
: :
:
:
Author: Mike Miessen
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101386
We have mySQL database but I didn't set it up myself. I'll talk to
Kevin (My system guy) when he becomes available and maybe he can show me
how to do this. We are both learning.
Assuming you are using SQL 2K... Go into enterprise manager and go into
the
table design view.
click on your date field and then in the default value field, type
getdate(). Now save your table and your done.
HTH
Clint
----- Excess quoted text cut - see Original Post for more -----
date
----- Excess quoted text cut - see Original Post for more -----
there
----- Excess quoted text cut - see Original Post for more -----
small
----- Excess quoted text cut - see Original Post for more -----
query
----- Excess quoted text cut - see Original Post for more -----
Author: Ben Doom
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101385
CFParam creates a default value for a CF variable (if the variable does not
exist, it creates it and assigns that value). It has nothing to do with the
data in the DB.
--Ben Doom
Programmer & General Lackey
Moonbow Software
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 2:03 PM
: To: CF-Talk
: Subject: RE: New User
:
:
: I tried
:
: <cfparam name="Event_Date" default="1/1/2002">
:
: both inside and just before the cfquery but it seems to make no
: difference.
:
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 1:52 PM
: To: CF-Talk
: Subject: RE: New User
:
: 1/1/1900 is the default date in MS SQL 2K (and, I assume, many other
: DBs).
: It sounds like you didn't set a default date when you created the
: column, so
: it's returning the system default.
:
:
:
: --Ben Doom
: Programmer & General Lackey
: Moonbow Software
:
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:34 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: :
: : OK that sounds reasonable I'll try that. Now I'm trying to add a date
: : display field but it is returning the same date each time 01/01/1900
: and
: : I know that's not right :)
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:25 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: : You will need to put back in the leading % in case the word they are
: : searching for is in the middle of a title.
: :
: : Example
: :
: : Search string = "Time"
: :
: : Will return = "Time to go"
: :
: : Will not return = "It's Time to go."
: :
: : Also someone else mentioned using upper(), on the column and the
: search
: : string your looking for to get by the case sensitivity of the db, I
: : would recommend you doing it as well.
: :
: : Tim
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:15 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: :
: : I took out the leading % and I dropped the ?TITLE from the action on
: the
: : process button and my query now works. Thanks to you guys :)
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 12:07 PM
: : To: CF-Talk
: : Subject: Re: New User
: :
: : Take out the leading % and your query will work. With both % in there
: : this
: : returns everything because to SQL, your string is like everything in
: the
: : database.
: :
: : HTH,
: : Clint
: :
: : ----- Original Message -----
: : From: "Mike Miessen" <mdmiessen@indy.rr.com>
: : To: "CF-Talk" <cf-talk@houseoffusion.com>
: : Sent: Thursday, December 26, 2002 11:03 AM
: : Subject: New User
: :
: :
: : > I have been trying to do a search of a database. It is a very small
: : > testing database and I wrote a search entry form with dream weaver
: : with
: : > one field. This field should search on the title field of the
: : database
: : > and return results that contain the entry. I am a raw newbie here
: and
: : > contemplating beating my head against a wall on this. Well my query
: : > does not seem to work. I get all the records returned every time
: not
: : > just the ones that contain the search term.
: : >
: : > Here I was thinking this would be easy. Boy was I wrong! Here is
: my
: : > code Can anyone tell me what I'm doing wrong? The path to the
: : search
: : > form is
: : >
: : > http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
: : >
: : >
: : >
: : > <cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
: : > password="YeaRight" debug="yes">
: : > <cfparam name="TITLE" default="null">
: : > SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
: : > </cfquery>
: : >
: : > <html>
: : > <head>
: : > <title>Query Results</title>
: : > <meta http-equiv="Content-Type" content="text/html;
: : charset=iso-8859-1">
: : > </head>
: : >
: : > <body>
: : > <cfoutput query="rsTitle">
: : > #rsTitle.Title#<br>
: : > </cfoutput>
: : >
: : > </body>
: : > </html>
: : >
: : >
: :
: :
: :
: :
:
:
Author: Mike Miessen
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101384
I may have to wait for my system admin to do this for me. I'm
encouraging him to join this list. He is trying to learn this stuff
too. We are both new to it. I apologize for all the stupid questions
but we have gotten in over our head I suppose. It has been quite a
ride.
Depends on the DB. In MS-SQL you can set it in Server Enterprise
Manager
pretty easily in the define table view. The easiest thing here, if that
is
the DB you're using and you have access to the Manager, is to remove
that
column from the table and recreate it with a default value (look at the
options in the bottom half of the screen).
If it's something else, you'll have to ask someone else. :-)
--Ben Doom
Programmer & General Lackey
Moonbow Software
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 1:56 PM
: To: CF-Talk
: Subject: RE: New User
:
:
: How do I set a default date?
:
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 1:52 PM
: To: CF-Talk
: Subject: RE: New User
:
: 1/1/1900 is the default date in MS SQL 2K (and, I assume, many other
: DBs).
: It sounds like you didn't set a default date when you created the
: column, so
: it's returning the system default.
:
:
:
: --Ben Doom
: Programmer & General Lackey
: Moonbow Software
:
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:34 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: :
: : OK that sounds reasonable I'll try that. Now I'm trying to add a
date
: : display field but it is returning the same date each time 01/01/1900
: and
: : I know that's not right :)
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:25 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: : You will need to put back in the leading % in case the word they are
: : searching for is in the middle of a title.
: :
: : Example
: :
: : Search string = "Time"
: :
: : Will return = "Time to go"
: :
: : Will not return = "It's Time to go."
: :
: : Also someone else mentioned using upper(), on the column and the
: search
: : string your looking for to get by the case sensitivity of the db, I
: : would recommend you doing it as well.
: :
: : Tim
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:15 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: :
: : I took out the leading % and I dropped the ?TITLE from the action on
: the
: : process button and my query now works. Thanks to you guys :)
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 12:07 PM
: : To: CF-Talk
: : Subject: Re: New User
: :
: : Take out the leading % and your query will work. With both % in
there
: : this
: : returns everything because to SQL, your string is like everything in
: the
: : database.
: :
: : HTH,
: : Clint
: :
: : ----- Original Message -----
: : From: "Mike Miessen" <mdmiessen@indy.rr.com>
: : To: "CF-Talk" <cf-talk@houseoffusion.com>
: : Sent: Thursday, December 26, 2002 11:03 AM
: : Subject: New User
: :
: :
: : > I have been trying to do a search of a database. It is a very
small
: : > testing database and I wrote a search entry form with dream weaver
: : with
: : > one field. This field should search on the title field of the
: : database
: : > and return results that contain the entry. I am a raw newbie here
: and
: : > contemplating beating my head against a wall on this. Well my
query
: : > does not seem to work. I get all the records returned every time
: not
: : > just the ones that contain the search term.
: : >
: : > Here I was thinking this would be easy. Boy was I wrong! Here is
: my
: : > code Can anyone tell me what I'm doing wrong? The path to the
: : search
: : > form is
: : >
: : > http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
: : >
: : >
: : >
: : > <cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
: : > password="YeaRight" debug="yes">
: : > <cfparam name="TITLE" default="null">
: : > SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
: : > </cfquery>
: : >
: : > <html>
: : > <head>
: : > <title>Query Results</title>
: : > <meta http-equiv="Content-Type" content="text/html;
: : charset=iso-8859-1">
: : > </head>
: : >
: : > <body>
: : > <cfoutput query="rsTitle">
: : > #rsTitle.Title#<br>
: : > </cfoutput>
: : >
: : > </body>
: : > </html>
: : >
: : >
: :
: :
: :
: :
:
:
Author: Mike Miessen
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101382
I tried
<cfparam name="Event_Date" default="1/1/2002">
both inside and just before the cfquery but it seems to make no
difference.
1/1/1900 is the default date in MS SQL 2K (and, I assume, many other
DBs).
It sounds like you didn't set a default date when you created the
column, so
it's returning the system default.
--Ben Doom
Programmer & General Lackey
Moonbow Software
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 1:34 PM
: To: CF-Talk
: Subject: RE: New User
:
:
: OK that sounds reasonable I'll try that. Now I'm trying to add a date
: display field but it is returning the same date each time 01/01/1900
and
: I know that's not right :)
:
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 1:25 PM
: To: CF-Talk
: Subject: RE: New User
:
: You will need to put back in the leading % in case the word they are
: searching for is in the middle of a title.
:
: Example
:
: Search string = "Time"
:
: Will return = "Time to go"
:
: Will not return = "It's Time to go."
:
: Also someone else mentioned using upper(), on the column and the
search
: string your looking for to get by the case sensitivity of the db, I
: would recommend you doing it as well.
:
: Tim
:
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 1:15 PM
: To: CF-Talk
: Subject: RE: New User
:
:
: I took out the leading % and I dropped the ?TITLE from the action on
the
: process button and my query now works. Thanks to you guys :)
:
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 12:07 PM
: To: CF-Talk
: Subject: Re: New User
:
: Take out the leading % and your query will work. With both % in there
: this
: returns everything because to SQL, your string is like everything in
the
: database.
:
: HTH,
: Clint
:
: ----- Original Message -----
: From: "Mike Miessen" <mdmiessen@indy.rr.com>
: To: "CF-Talk" <cf-talk@houseoffusion.com>
: Sent: Thursday, December 26, 2002 11:03 AM
: Subject: New User
:
:
: > I have been trying to do a search of a database. It is a very small
: > testing database and I wrote a search entry form with dream weaver
: with
: > one field. This field should search on the title field of the
: database
: > and return results that contain the entry. I am a raw newbie here
and
: > contemplating beating my head against a wall on this. Well my query
: > does not seem to work. I get all the records returned every time
not
: > just the ones that contain the search term.
: >
: > Here I was thinking this would be easy. Boy was I wrong! Here is
my
: > code Can anyone tell me what I'm doing wrong? The path to the
: search
: > form is
: >
: > http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
: >
: >
: >
: > <cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
: > password="YeaRight" debug="yes">
: > <cfparam name="TITLE" default="null">
: > SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
: > </cfquery>
: >
: > <html>
: > <head>
: > <title>Query Results</title>
: > <meta http-equiv="Content-Type" content="text/html;
: charset=iso-8859-1">
: > </head>
: >
: > <body>
: > <cfoutput query="rsTitle">
: > #rsTitle.Title#<br>
: > </cfoutput>
: >
: > </body>
: > </html>
: >
: >
:
:
:
:
Author: Clint Tredway
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101380
Assuming you are using SQL 2K... Go into enterprise manager and go into the
table design view.
click on your date field and then in the default value field, type
getdate(). Now save your table and your done.
HTH
Clint
----- Excess quoted text cut - see Original Post for more -----
Author: Ben Doom
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101379
Depends on the DB. In MS-SQL you can set it in Server Enterprise Manager
pretty easily in the define table view. The easiest thing here, if that is
the DB you're using and you have access to the Manager, is to remove that
column from the table and recreate it with a default value (look at the
options in the bottom half of the screen).
If it's something else, you'll have to ask someone else. :-)
--Ben Doom
Programmer & General Lackey
Moonbow Software
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 1:56 PM
: To: CF-Talk
: Subject: RE: New User
:
:
: How do I set a default date?
:
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 1:52 PM
: To: CF-Talk
: Subject: RE: New User
:
: 1/1/1900 is the default date in MS SQL 2K (and, I assume, many other
: DBs).
: It sounds like you didn't set a default date when you created the
: column, so
: it's returning the system default.
:
:
:
: --Ben Doom
: Programmer & General Lackey
: Moonbow Software
:
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:34 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: :
: : OK that sounds reasonable I'll try that. Now I'm trying to add a date
: : display field but it is returning the same date each time 01/01/1900
: and
: : I know that's not right :)
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:25 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: : You will need to put back in the leading % in case the word they are
: : searching for is in the middle of a title.
: :
: : Example
: :
: : Search string = "Time"
: :
: : Will return = "Time to go"
: :
: : Will not return = "It's Time to go."
: :
: : Also someone else mentioned using upper(), on the column and the
: search
: : string your looking for to get by the case sensitivity of the db, I
: : would recommend you doing it as well.
: :
: : Tim
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 1:15 PM
: : To: CF-Talk
: : Subject: RE: New User
: :
: :
: : I took out the leading % and I dropped the ?TITLE from the action on
: the
: : process button and my query now works. Thanks to you guys :)
: :
: : -----Original Message-----
: :
: : Sent: Thursday, December 26, 2002 12:07 PM
: : To: CF-Talk
: : Subject: Re: New User
: :
: : Take out the leading % and your query will work. With both % in there
: : this
: : returns everything because to SQL, your string is like everything in
: the
: : database.
: :
: : HTH,
: : Clint
: :
: : ----- Original Message -----
: : From: "Mike Miessen" <mdmiessen@indy.rr.com>
: : To: "CF-Talk" <cf-talk@houseoffusion.com>
: : Sent: Thursday, December 26, 2002 11:03 AM
: : Subject: New User
: :
: :
: : > I have been trying to do a search of a database. It is a very small
: : > testing database and I wrote a search entry form with dream weaver
: : with
: : > one field. This field should search on the title field of the
: : database
: : > and return results that contain the entry. I am a raw newbie here
: and
: : > contemplating beating my head against a wall on this. Well my query
: : > does not seem to work. I get all the records returned every time
: not
: : > just the ones that contain the search term.
: : >
: : > Here I was thinking this would be easy. Boy was I wrong! Here is
: my
: : > code Can anyone tell me what I'm doing wrong? The path to the
: : search
: : > form is
: : >
: : > http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
: : >
: : >
: : >
: : > <cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
: : > password="YeaRight" debug="yes">
: : > <cfparam name="TITLE" default="null">
: : > SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
: : > </cfquery>
: : >
: : > <html>
: : > <head>
: : > <title>Query Results</title>
: : > <meta http-equiv="Content-Type" content="text/html;
: : charset=iso-8859-1">
: : > </head>
: : >
: : > <body>
: : > <cfoutput query="rsTitle">
: : > #rsTitle.Title#<br>
: : > </cfoutput>
: : >
: : > </body>
: : > </html>
: : >
: : >
: :
: :
: :
: :
:
:
Author: Mike Miessen
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101378
How do I set a default date?
1/1/1900 is the default date in MS SQL 2K (and, I assume, many other
DBs).
It sounds like you didn't set a default date when you created the
column, so
it's returning the system default.
--Ben Doom
Programmer & General Lackey
Moonbow Software
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 1:34 PM
: To: CF-Talk
: Subject: RE: New User
:
:
: OK that sounds reasonable I'll try that. Now I'm trying to add a date
: display field but it is returning the same date each time 01/01/1900
and
: I know that's not right :)
:
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 1:25 PM
: To: CF-Talk
: Subject: RE: New User
:
: You will need to put back in the leading % in case the word they are
: searching for is in the middle of a title.
:
: Example
:
: Search string = "Time"
:
: Will return = "Time to go"
:
: Will not return = "It's Time to go."
:
: Also someone else mentioned using upper(), on the column and the
search
: string your looking for to get by the case sensitivity of the db, I
: would recommend you doing it as well.
:
: Tim
:
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 1:15 PM
: To: CF-Talk
: Subject: RE: New User
:
:
: I took out the leading % and I dropped the ?TITLE from the action on
the
: process button and my query now works. Thanks to you guys :)
:
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 12:07 PM
: To: CF-Talk
: Subject: Re: New User
:
: Take out the leading % and your query will work. With both % in there
: this
: returns everything because to SQL, your string is like everything in
the
: database.
:
: HTH,
: Clint
:
: ----- Original Message -----
: From: "Mike Miessen" <mdmiessen@indy.rr.com>
: To: "CF-Talk" <cf-talk@houseoffusion.com>
: Sent: Thursday, December 26, 2002 11:03 AM
: Subject: New User
:
:
: > I have been trying to do a search of a database. It is a very small
: > testing database and I wrote a search entry form with dream weaver
: with
: > one field. This field should search on the title field of the
: database
: > and return results that contain the entry. I am a raw newbie here
and
: > contemplating beating my head against a wall on this. Well my query
: > does not seem to work. I get all the records returned every time
not
: > just the ones that contain the search term.
: >
: > Here I was thinking this would be easy. Boy was I wrong! Here is
my
: > code Can anyone tell me what I'm doing wrong? The path to the
: search
: > form is
: >
: > http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
: >
: >
: >
: > <cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
: > password="YeaRight" debug="yes">
: > <cfparam name="TITLE" default="null">
: > SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
: > </cfquery>
: >
: > <html>
: > <head>
: > <title>Query Results</title>
: > <meta http-equiv="Content-Type" content="text/html;
: charset=iso-8859-1">
: > </head>
: >
: > <body>
: > <cfoutput query="rsTitle">
: > #rsTitle.Title#<br>
: > </cfoutput>
: >
: > </body>
: > </html>
: >
: >
:
:
:
:
Author: Mike Miessen
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101377
Well I had double quotes so I changed that.
<cfoutput query="rsTitle">
#dateformat(Event_Date, 'dd/mmm/yyyy')# #rsTitle.Title#<br>
</cfoutput>
I still get the same type of problem however. Seems I get the same
date for all entries and a date that does not exist in the database at
that.
01/Jan/1900 Sacred Ground
01/Jan/1900 Sacred Ground
01/Jan/1900 Sacred Ground
01/Jan/1900 Sacred Ground
try this
#DateFormat(yourDateField,'mm/dd/yyyy')#
..tony
Tony Weeg
Senior Web Developer
UnCertified Advanced ColdFusion Developer
Information System Design
Navtrak, Inc.
Mobile workforce monitoring, mapping & reporting
www.navtrak.net
410.548.2337
OK that sounds reasonable I'll try that. Now I'm trying to add a date
display field but it is returning the same date each time 01/01/1900 and
I know that's not right :)
You will need to put back in the leading % in case the word they are
searching for is in the middle of a title.
Example
Search string = "Time"
Will return = "Time to go"
Will not return = "It's Time to go."
Also someone else mentioned using upper(), on the column and the search
string your looking for to get by the case sensitivity of the db, I
would recommend you doing it as well.
Tim
I took out the leading % and I dropped the ?TITLE from the action on the
process button and my query now works. Thanks to you guys :)
Take out the leading % and your query will work. With both % in there
this
returns everything because to SQL, your string is like everything in the
database.
HTH,
Clint
> I have been trying to do a search of a database. It is a very small
> testing database and I wrote a search entry form with dream weaver
with
> one field. This field should search on the title field of the
database
> and return results that contain the entry. I am a raw newbie here and
> contemplating beating my head against a wall on this. Well my query
> does not seem to work. I get all the records returned every time not
> just the ones that contain the search term.
>
> Here I was thinking this would be easy. Boy was I wrong! Here is my
> code Can anyone tell me what I'm doing wrong? The path to the
search
----- Excess quoted text cut - see Original Post for more -----
charset=iso-8859-1">
----- Excess quoted text cut - see Original Post for more -----
Author: Ben Doom
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101376
1/1/1900 is the default date in MS SQL 2K (and, I assume, many other DBs).
It sounds like you didn't set a default date when you created the column, so
it's returning the system default.
--Ben Doom
Programmer & General Lackey
Moonbow Software
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 1:34 PM
: To: CF-Talk
: Subject: RE: New User
:
:
: OK that sounds reasonable I'll try that. Now I'm trying to add a date
: display field but it is returning the same date each time 01/01/1900 and
: I know that's not right :)
:
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 1:25 PM
: To: CF-Talk
: Subject: RE: New User
:
: You will need to put back in the leading % in case the word they are
: searching for is in the middle of a title.
:
: Example
:
: Search string = "Time"
:
: Will return = "Time to go"
:
: Will not return = "It's Time to go."
:
: Also someone else mentioned using upper(), on the column and the search
: string your looking for to get by the case sensitivity of the db, I
: would recommend you doing it as well.
:
: Tim
:
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 1:15 PM
: To: CF-Talk
: Subject: RE: New User
:
:
: I took out the leading % and I dropped the ?TITLE from the action on the
: process button and my query now works. Thanks to you guys :)
:
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 12:07 PM
: To: CF-Talk
: Subject: Re: New User
:
: Take out the leading % and your query will work. With both % in there
: this
: returns everything because to SQL, your string is like everything in the
: database.
:
: HTH,
: Clint
:
: ----- Original Message -----
: From: "Mike Miessen" <mdmiessen@indy.rr.com>
: To: "CF-Talk" <cf-talk@houseoffusion.com>
: Sent: Thursday, December 26, 2002 11:03 AM
: Subject: New User
:
:
: > I have been trying to do a search of a database. It is a very small
: > testing database and I wrote a search entry form with dream weaver
: with
: > one field. This field should search on the title field of the
: database
: > and return results that contain the entry. I am a raw newbie here and
: > contemplating beating my head against a wall on this. Well my query
: > does not seem to work. I get all the records returned every time not
: > just the ones that contain the search term.
: >
: > Here I was thinking this would be easy. Boy was I wrong! Here is my
: > code Can anyone tell me what I'm doing wrong? The path to the
: search
: > form is
: >
: > http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
: >
: >
: >
: > <cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
: > password="YeaRight" debug="yes">
: > <cfparam name="TITLE" default="null">
: > SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
: > </cfquery>
: >
: > <html>
: > <head>
: > <title>Query Results</title>
: > <meta http-equiv="Content-Type" content="text/html;
: charset=iso-8859-1">
: > </head>
: >
: > <body>
: > <cfoutput query="rsTitle">
: > #rsTitle.Title#<br>
: > </cfoutput>
: >
: > </body>
: > </html>
: >
: >
:
:
:
:
Author: Tony Weeg
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101375
try this
#DateFormat(yourDateField,'mm/dd/yyyy')#
...tony
Tony Weeg
Senior Web Developer
UnCertified Advanced ColdFusion Developer
Information System Design
Navtrak, Inc.
Mobile workforce monitoring, mapping & reporting
www.navtrak.net
410.548.2337
OK that sounds reasonable I'll try that. Now I'm trying to add a date
display field but it is returning the same date each time 01/01/1900 and
I know that's not right :)
You will need to put back in the leading % in case the word they are
searching for is in the middle of a title.
Example
Search string = "Time"
Will return = "Time to go"
Will not return = "It's Time to go."
Also someone else mentioned using upper(), on the column and the search
string your looking for to get by the case sensitivity of the db, I
would recommend you doing it as well.
Tim
I took out the leading % and I dropped the ?TITLE from the action on the
process button and my query now works. Thanks to you guys :)
Take out the leading % and your query will work. With both % in there
this
returns everything because to SQL, your string is like everything in the
database.
HTH,
Clint
> I have been trying to do a search of a database. It is a very small
> testing database and I wrote a search entry form with dream weaver
with
> one field. This field should search on the title field of the
database
> and return results that contain the entry. I am a raw newbie here and
> contemplating beating my head against a wall on this. Well my query
> does not seem to work. I get all the records returned every time not
> just the ones that contain the search term.
>
> Here I was thinking this would be easy. Boy was I wrong! Here is my
> code Can anyone tell me what I'm doing wrong? The path to the
search
----- Excess quoted text cut - see Original Post for more -----
charset=iso-8859-1">
----- Excess quoted text cut - see Original Post for more -----
Author: Mike Miessen
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101374
OK that sounds reasonable I'll try that. Now I'm trying to add a date
display field but it is returning the same date each time 01/01/1900 and
I know that's not right :)
You will need to put back in the leading % in case the word they are
searching for is in the middle of a title.
Example
Search string = "Time"
Will return = "Time to go"
Will not return = "It's Time to go."
Also someone else mentioned using upper(), on the column and the search
string your looking for to get by the case sensitivity of the db, I
would recommend you doing it as well.
Tim
I took out the leading % and I dropped the ?TITLE from the action on the
process button and my query now works. Thanks to you guys :)
Take out the leading % and your query will work. With both % in there
this
returns everything because to SQL, your string is like everything in the
database.
HTH,
Clint
> I have been trying to do a search of a database. It is a very small
> testing database and I wrote a search entry form with dream weaver
with
> one field. This field should search on the title field of the
database
> and return results that contain the entry. I am a raw newbie here and
> contemplating beating my head against a wall on this. Well my query
> does not seem to work. I get all the records returned every time not
> just the ones that contain the search term.
>
> Here I was thinking this would be easy. Boy was I wrong! Here is my
> code Can anyone tell me what I'm doing wrong? The path to the
search
----- Excess quoted text cut - see Original Post for more -----
charset=iso-8859-1">
----- Excess quoted text cut - see Original Post for more -----
Author: Brian Ledwith
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101373
You might want to plug that "%" back in, as Scott Brady mentioned.
Using his "WHERE Title LIKE '%dog%'" example, if you take out the
leading "%", the word "hotdog" wouldn't be returned, and I think you
would want it to. On your site, if I search for "grass" I get nothing,
but if I search for "blue", I get a number of results. See what I mean?
With the leading and trailing "%", i.e. WHERE Title LIKE '%dog%'
Hotdog, hotdogs, and dog and dogs would be returned
With just the trailing "%", i.e. WHERE Title LIKE 'dog%'
Dog and dogs would be returned, but not hotdog or hotdogs
With just the leading "%", i.e. WHERE Title LIKE '%dog'
Dog and hotdog would be returned, but not hotdogs or dogs
HTH,
~bgl
--> -----Original Message-----
--
--> Sent: Thursday, December 26, 2002 10:15 AM
--> To: CF-Talk
--> Subject: RE: New User
-->
--> I took out the leading % and I dropped the ?TITLE from the action on
the
--> process button and my query now works. Thanks to you guys :)
-->
--> -----Original Message-----
--
--> Sent: Thursday, December 26, 2002 12:07 PM
--> To: CF-Talk
--> Subject: Re: New User
-->
--> Take out the leading % and your query will work. With both % in
there
--> this
--> returns everything because to SQL, your string is like everything in
the
--> database.
-->
--> HTH,
--> Clint
-->
--> ----- Original Message -----
--> From: "Mike Miessen" <mdmiessen@indy.rr.com>
--> To: "CF-Talk" <cf-talk@houseoffusion.com>
--> Sent: Thursday, December 26, 2002 11:03 AM
--> Subject: New User
-->
-->
--> > I have been trying to do a search of a database. It is a very
small
--> > testing database and I wrote a search entry form with dream weaver
--> with
--> > one field. This field should search on the title field of the
--> database
--> > and return results that contain the entry. I am a raw newbie here
and
--> > contemplating beating my head against a wall on this. Well my
query
--> > does not seem to work. I get all the records returned every time
not
--> > just the ones that contain the search term.
--> >
--> > Here I was thinking this would be easy. Boy was I wrong! Here is
my
--> > code Can anyone tell me what I'm doing wrong? The path to the
--> search
--> > form is
--> >
--> > http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
--> >
--> >
--> >
--> > <cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
--> > password="YeaRight" debug="yes">
--> > <cfparam name="TITLE" default="null">
--> > SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
--> > </cfquery>
--> >
--> > <html>
--> > <head>
--> > <title>Query Results</title>
--> > <meta http-equiv="Content-Type" content="text/html;
--> charset=iso-8859-1">
--> > </head>
--> >
--> > <body>
--> > <cfoutput query="rsTitle">
--> > #rsTitle.Title#<br>
--> > </cfoutput>
--> >
--> > </body>
--> > </html>
--> >
--> >
-->
-->
Author: Timothy Heald
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101372
You will need to put back in the leading % in case the word they are searching
for is in the middle of a title.
Example
Search string = "Time"
Will return = "Time to go"
Will not return = "It's Time to go."
Also someone else mentioned using upper(), on the column and the search string
your looking for to get by the case sensitivity of the db, I would recommend you
doing it as well.
Tim
I took out the leading % and I dropped the ?TITLE from the action on the
process button and my query now works. Thanks to you guys :)
Take out the leading % and your query will work. With both % in there
this
returns everything because to SQL, your string is like everything in the
database.
HTH,
Clint
> I have been trying to do a search of a database. It is a very small
> testing database and I wrote a search entry form with dream weaver
with
> one field. This field should search on the title field of the
database
> and return results that contain the entry. I am a raw newbie here and
> contemplating beating my head against a wall on this. Well my query
> does not seem to work. I get all the records returned every time not
> just the ones that contain the search term.
>
> Here I was thinking this would be easy. Boy was I wrong! Here is my
> code Can anyone tell me what I'm doing wrong? The path to the
search
----- Excess quoted text cut - see Original Post for more -----
charset=iso-8859-1">
----- Excess quoted text cut - see Original Post for more -----
Author: Mike Miessen
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101370
I took out the leading % and I dropped the ?TITLE from the action on the
process button and my query now works. Thanks to you guys :)
Take out the leading % and your query will work. With both % in there
this
returns everything because to SQL, your string is like everything in the
database.
HTH,
Clint
> I have been trying to do a search of a database. It is a very small
> testing database and I wrote a search entry form with dream weaver
with
> one field. This field should search on the title field of the
database
> and return results that contain the entry. I am a raw newbie here and
> contemplating beating my head against a wall on this. Well my query
> does not seem to work. I get all the records returned every time not
> just the ones that contain the search term.
>
> Here I was thinking this would be easy. Boy was I wrong! Here is my
> code Can anyone tell me what I'm doing wrong? The path to the
search
----- Excess quoted text cut - see Original Post for more -----
charset=iso-8859-1">
----- Excess quoted text cut - see Original Post for more -----
Author: Mike Miessen
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101369
I thank you all for the guidance. I will be looking at all of this
soon. I have also been fighting a battle with response times from my
server. This is not the fault of CF but rather a problem with our
carrier. We are tied into Cogentco and AOL has unexpectedly pulled one
of their servers from the pipe. This has caused a major hole in the web
that is affecting response times such that even the most minor change
takes several minutes to make. This has added greatly to my
frustration. I hope none of you have this problem.
Cogent Service Slows to a Crawl
Peering with AOL shut off
Written by Justin Beech
Cogent customers received the bad news that recent slowdowns may have
been caused by AOL shutting off its peer (direct connection) to Cogent.
No explanation was offered for why AOL might be doing that.
12/19 According to Cogent NOC support staff, the Cogent and Level 3
attorneys will meet on 12/22 to discuss the week-long outage caused when
AOL shut off a large bandwidth pipes for peering between Cogent and AOL.
12/17 - Letters from Cogent acknowledge the slowdown:
Dear Cogent Customer,
We are very sorry to hear you are experiencing problems with your
connection.
The issue in this case is with AOL. We have had an ongoing peering
relationship with them based on a connection of 2 OC-12s. We recently
upgraded these connections to include 2 OC-48s to accommodate our
significant traffic exchange. These connections have been up and running
smoothly for 2 weeks now. Overall, we've spent over $100 thousand to
create this robust peering infrastructure.
This week, however, AOL announced a unilateral decision to cut off all
our connections. This announcement came as a surprise to all involved
and the reasons behind it remain unclear.
We are struggling to make sense of AOL's decision and are working around
the clock to try to get it resolved. If, by next week, you haven't seen
some improvement, feel free to call us back. We want to assure you that
we are trying our best to stay on top of this critical issue and give
our customers the best service possible.
We're aware that this is affecting some of our customers and we are
working to improve things as quickly as possible.
Thank you for your patience. We understand this affects your business
and we apologize for the temporary performance lapse.
We encourage you to contact the AOL Customer Support number at
800.827.6364 and/or AOL NOC Support at 703.265.5431 to register your
complaints towards AOL.
Sincerely,
Cogent Support
I have been trying to do a search of a database. It is a very small
testing database and I wrote a search entry form with dream weaver with
one field. This field should search on the title field of the database
and return results that contain the entry. I am a raw newbie here and
contemplating beating my head against a wall on this. Well my query
does not seem to work. I get all the records returned every time not
just the ones that contain the search term.
Here I was thinking this would be easy. Boy was I wrong! Here is my
code Can anyone tell me what I'm doing wrong? The path to the search
form is
http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
<cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
password="YeaRight" debug="yes">
<cfparam name="TITLE" default="null">
SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
</cfquery>
<html>
<head>
<title>Query Results</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<cfoutput query="rsTitle">
#rsTitle.Title#<br>
</cfoutput>
</body>
</html>
Author: Ali Daniali
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101365
I may be wrong on this but I don't think you can put <cfparam
name="TITLE" default="null"> in the <cfquery> tag pairs.
Try this
<cfparam name="TITLE" default="null">
<cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
password="YeaRight" debug="yes">
SELECT *
FROM bluegrasscalendar
WHERE Title LIKE '%#TITLE#%'
</cfquery>
Hope this works.
-AD
I have been trying to do a search of a database. It is a very small
testing database and I wrote a search entry form with dream weaver with
one field. This field should search on the title field of the database
and return results that contain the entry. I am a raw newbie here and
contemplating beating my head against a wall on this. Well my query
does not seem to work. I get all the records returned every time not
just the ones that contain the search term.
Here I was thinking this would be easy. Boy was I wrong! Here is my
code Can anyone tell me what I'm doing wrong? The path to the search
form is
http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
<cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
password="YeaRight" debug="yes">
<cfparam name="TITLE" default="null">
SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
</cfquery>
<html>
<head>
<title>Query Results</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<cfoutput query="rsTitle">
#rsTitle.Title#<br>
</cfoutput>
</body>
</html>
Author: Jerry Johnson
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101364
I think it is your submit page form tag.
<form name="EventTitleSearch" method="post"
action="TitleSearchResults.cfm?TITLE" >
you are going to end up with two "Title" variables on the results page, one
passed by the url line and one by the form.
Cold Fusion has to pick one of these two to default to, and it is going to
default to the url version (always).
So you can do a couple of things:
1. remove the ?title in the form action parameter.
2. specify the scope of the title variable in the results page
<cfparam name="form.TITLE" default="null">
<cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
password="YeaRight" debug="yes">
SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#form.TITLE#%'
</cfquery>
And I would move the cfparam out of the cfquery and place it one line above it.
HTH
Jerry Johnson
>>> mdmiessen@indy.rr.com 12/26/02 12:03PM >>>
I have been trying to do a search of a database. It is a very small
testing database and I wrote a search entry form with dream weaver with
one field. This field should search on the title field of the database
and return results that contain the entry. I am a raw newbie here and
contemplating beating my head against a wall on this. Well my query
does not seem to work. I get all the records returned every time not
just the ones that contain the search term.
Here I was thinking this would be easy. Boy was I wrong! Here is my
code Can anyone tell me what I'm doing wrong? The path to the search
form is
http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
<cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
password="YeaRight" debug="yes">
<cfparam name="TITLE" default="null">
SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
</cfquery>
<html>
<head>
<title>Query Results</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<cfoutput query="rsTitle">
#rsTitle.Title#<br>
</cfoutput>
</body>
</html>
Author: Scott Brady
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101363
>> SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
>Take out the leading % and your query will work. With both % in there this
>returns everything because to SQL, your string is like everything in the
>database.
I don't think so. If the variable "TITLE" is "dog", then the where clause is
"WHERE Title LIKE '%dog%'" which shouldn't return the entire table.
My guess is that "TITLE" ends up being an empty string (WHERE Title LIKE '%%'),
which brings back the entire table. Try outputting the variable "TITLE" and see
what you get. I'd also recommend scoping the variable, in case there is another
variable called Title in your page which is screwing you up.
Scott
--------------------------------
Scott Brady
http://www.scottbrady.net/
Author: Ben Doom
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101362
Why is the action for your form titlesearchresulsts.cfm?title ?
I would bet that that the fact that you are sending a null title in the url
and a title in the form is screwing up the scoping.
Further, if I were you, I'd scope title if possible. If you know it is
always submitted from a form via post, reference form.title instead (both in
the query and the cfparam). That will avoid possible confusion in the
future.
--Ben Doom
Programmer & General Lackey
Moonbow Software
: -----Original Message-----
:
: Sent: Thursday, December 26, 2002 12:04 PM
: To: CF-Talk
: Subject: New User
:
:
: I have been trying to do a search of a database. It is a very small
: testing database and I wrote a search entry form with dream weaver with
: one field. This field should search on the title field of the database
: and return results that contain the entry. I am a raw newbie here and
: contemplating beating my head against a wall on this. Well my query
: does not seem to work. I get all the records returned every time not
: just the ones that contain the search term.
:
: Here I was thinking this would be easy. Boy was I wrong! Here is my
: code Can anyone tell me what I'm doing wrong? The path to the search
: form is
:
: http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
:
:
:
: <cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
: password="YeaRight" debug="yes">
: <cfparam name="TITLE" default="null">
: SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
: </cfquery>
:
: <html>
: <head>
: <title>Query Results</title>
: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
: </head>
:
: <body>
: <cfoutput query="rsTitle">
: #rsTitle.Title#<br>
: </cfoutput>
:
: </body>
: </html>
:
:
Author: Everett, Al
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101361
If there is no value in the TITLE variable you will get the behavior you're
seeing.
1. Scope your variable. Form.Title instead of Title.
2. Trap for no value.
<cfif IsDefined("Form.Title") AND Len(Trim(Form.Title)) GT 0>
<cfquery ...>
...
</cfif>
3. SQL is case-sensitive. If you want case-insensitivity do something like
this in your WHERE clause:
UPPER(Title) LIKE '%#UCase(Form.TITLE)#%'
----- Excess quoted text cut - see Original Post for more -----
Author: Brian Ledwith
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101360
On your submission form, you have "TitleSearchResults.cfm?TITLE". Take
out the "?Title" and it works fine.
--> -----Original Message-----
--
--> Sent: Thursday, December 26, 2002 9:04 AM
--> To: CF-Talk
--> Subject: New User
-->
--> I have been trying to do a search of a database. It is a very small
--> testing database and I wrote a search entry form with dream weaver
with
--> one field. This field should search on the title field of the
database
--> and return results that contain the entry. I am a raw newbie here
and
--> contemplating beating my head against a wall on this. Well my query
--> does not seem to work. I get all the records returned every time
not
--> just the ones that contain the search term.
-->
--> Here I was thinking this would be easy. Boy was I wrong! Here is
my
--> code Can anyone tell me what I'm doing wrong? The path to the
search
--> form is
-->
--> http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
-->
-->
-->
--> <cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
--> password="YeaRight" debug="yes">
--> <cfparam name="TITLE" default="null">
--> SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
--> </cfquery>
-->
--> <html>
--> <head>
--> <title>Query Results</title>
--> <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
--> </head>
-->
--> <body>
--> <cfoutput query="rsTitle">
--> #rsTitle.Title#<br>
--> </cfoutput>
-->
--> </body>
--> </html>
-->
-->
Author: Timothy Heald
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101359
Try getting rid of the CFPARAM and scoping the #title# variable to form.title.
Also if I were you I would output #form.title# above the query to make sure it's
passing the correct value.
Tim
I have been trying to do a search of a database. It is a very small
testing database and I wrote a search entry form with dream weaver with
one field. This field should search on the title field of the database
and return results that contain the entry. I am a raw newbie here and
contemplating beating my head against a wall on this. Well my query
does not seem to work. I get all the records returned every time not
just the ones that contain the search term.
Here I was thinking this would be easy. Boy was I wrong! Here is my
code Can anyone tell me what I'm doing wrong? The path to the search
form is
http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
<cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
password="YeaRight" debug="yes">
<cfparam name="TITLE" default="null">
SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
</cfquery>
<html>
<head>
<title>Query Results</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<cfoutput query="rsTitle">
#rsTitle.Title#<br>
</cfoutput>
</body>
</html>
Author: Clint Tredway
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101358
Take out the leading % and your query will work. With both % in there this
returns everything because to SQL, your string is like everything in the
database.
HTH,
Clint
----- Excess quoted text cut - see Original Post for more -----
Author: Mike Miessen
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:20052#101356
I have been trying to do a search of a database. It is a very small
testing database and I wrote a search entry form with dream weaver with
one field. This field should search on the title field of the database
and return results that contain the entry. I am a raw newbie here and
contemplating beating my head against a wall on this. Well my query
does not seem to work. I get all the records returned every time not
just the ones that contain the search term.
Here I was thinking this would be easy. Boy was I wrong! Here is my
code Can anyone tell me what I'm doing wrong? The path to the search
form is
http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
<cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
password="YeaRight" debug="yes">
<cfparam name="TITLE" default="null">
SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
</cfquery>
<html>
<head>
<title>Query Results</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<cfoutput query="rsTitle">
#rsTitle.Title#<br>
</cfoutput>
</body>
</html>
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||