RE: Query Help!!

2001-05-11 Thread Hayes, David

I assume session.total is a numeric value; try getting rid of the quotes.

-Original Message-
From: ibtoad [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 3:01 PM
To: CF-Talk
Subject: Query Help!!


Does anyone see any problems with the following query:

cfquery name=get_shipratedollars datasource=#config.datasource#
Select shiprate from shipratesdollars
WHERE '#session.total#' = shipfrom
and '#session.total#' = shipto
/cfquery


I can not figure out why I am getting incorrect results.  Sometimes it will
pull more than one record and sometimes it will pull the max record only.
Here is a copy of the table I am using named shipratedollars.

ID  shiprateshipfrom shipto
1   4.00 0.00 50.00
2   6.0050.01100.00
3   8.00   100.01200.00
4   12.00  200.01300.00
5   18.00  300.01500.00
6   25.00  500.01750.00
7   40.00  750.01   1000.00
8   50.00 1000.01   1500.00
9   70.00 1500.01   2000.00
10  100.00  2000.009.00


Thansk,
Rich
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Need help for input type=file

2001-05-07 Thread Hayes, David

No; it would be a bit of a security issue if you could.  (Your page could
select any file from a user's machine and intiate an upload.)

What I did in a previous project was simply display the file name and path
near the upload control, with instructions to drag/drop or copy/paste the
value in the control.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 07, 2001 8:33 AM
To: CF-Talk
Subject: Need help for input type=file





Hi,
Is there a way to dynamic assign value for input field type=file without
click
the browse button?

here is an example


form action=/cgi-bin/upload method=post
enctype=multipart/form-data
input type=hidden name=username value=br
input type=hidden name=password value=br
input type=file name=FileName


input type=button value=View Value
onClick=alert(this.form.FileName.value)
/form
script
document.forms[0].FileName.value= c:\WebSite\dmcs200105040214;
alert(document.forms[0].FileName.value);
/script


thanks for any suggestion


YC




www.atswebnet.com

-kev

~
Kevin Mansel
Web Developer
Fox Communications
[EMAIL PROTECTED]
DL : 425-649-1321
C : 425-346-7221



-Original Message-
From: Guy McDowell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 6:52 AM
To: CF-Talk
Subject: Inexpensive Hosting


G'day eh?

I'm trying to find very inexpensive CF hosting to no
avail. Something under $20 CDN is preferred. I need to
host my personal/resume site along with some CF
examples I have done.

Thought I saw someone post something about hosting for
$5.95 a month

If there is nothing like that, then is it possible for
me to institute CF Server Express within my own
account/directory on a regular hosting package of the
WinNT variety?

Guy
www.guymcdowell.com


Archives:
http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe:
http://www.houseoffusion.com/index.cfm?sidebar=lists
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: (sql) Group by Month query

2001-05-07 Thread Hayes, David

The problem is you are still grouping on the specific dateJoined.


Try something like 

SELECT Month(DateJoined) + ' ' + Year(DateJoined) as monthJoined,
Count(*) as MonthJoinedCount
FROM Admin
GROUP BY Month(DateJoined) + ' ' + Year(DateJoined)
ORDER BY Count(*) DESC

-Original Message-
From: Owens, Howard [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 07, 2001 11:31 AM
To: CF-Talk
Subject: (sql) Group by Month query




I've been trying to get this group by month query to produced the desired
results.  So far it's not working.

In my database, I have a field called DateJoined  This is the actually
date somebody joined, i.e. 1/24/01, 1/22/01, 1/5/01.  In other words, it's
by the day.  Now I want to get a report on how many people joined in Jan.
2001, as well as June 1999, etc.

Here's the latest iteration of my query:


cfquery name=MonthJoined
 datasource=#application.DSN#
SELECT DateJoined, Year(Month(DateJoined)) as MonthCount,
Count(Year(Month(DateJoined))) as MonthJoinedCount
FROM Admin
GROUP BY Month(DateJoined), DateJoined
ORDER BY Count(Month(Year(DateJoined))) DESC
/cfquery


What I get is something like (using just January as an example):

January 2001: 20
January 2001: 5
January 2001: 34
January 2001: 26

Now the total, if you ad up all of those January 2001s is correct.

But what I need is: 

January 2001: 85

I can't figure out why it's not grouping all of the Jan 2001s together (same
goes for other months, other years).

BTW:  I'm using an Access DB.  I tried the query suggestion of at least on
person the list to use DatePart() instead of Month() and using DatePart()
always through an error.  I stumbled across something on the Web where a
person was using Month() in a query, so I tried it and it didn't throw an
error.


H.




Howard Owens
Internet Operations Coordinator
www.insidevc.com
[EMAIL PROTECTED]
AIM: GoCatGo1956
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: I'm sure this worked earlier

2001-05-02 Thread Hayes, David

Looks like you have some single quote issues.  

-Original Message-
From: Darren Adams [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 6:11 AM
To: CF-Talk
Subject: RE: I'm sure this worked earlier


Here you go:

I have now removed the excluded text so that it is just getting the headline
and sticking it in the headline in pressoffice on cosmos1.


Error Diagnostic Information
ODBC Error Code = 37000 (Syntax error or access violation)


[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in
query expression ''Quatre nouvelles langues d'Europe pour SunSystems')'.



The error occurred while processing an element with a general identifier of
(CFQUERY), occupying document position (29:2) to (29:60).


Date/Time: 05/02/01 12:09:35
Browser: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt)
Remote Address: 129.153.207.20
Template: E:\Inetpub\publicsite\menutest\pressoffice\convertnews.cfm

-Original Message-
From: Bruce Heerssen [mailto:[EMAIL PROTECTED]]
Sent: 01 May 2001 17:05
To: CF-Talk
Subject: RE: I'm sure this worked earlier


It would also help if you can post the error message.

-Bruce

 -Original Message-
 From: Dylan Bromby [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, May 01, 2001 10:18 AM
 To: CF-Talk
 Subject: RE: I'm sure this worked earlier
 
 
 can you provide the datatypes of the fields?
 
 -Original Message-
 From: Darren Adams [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, May 01, 2001 8:04 AM
 To: CF-Talk
 Subject: I'm sure this worked earlier
 
 
 Hello Folks,
 
 Can any of you eagle eyed people spot why I am getting a ODBC Error Code
=
 37000 (Syntax error or access violation)  error when I run this.
 I had it working earlier and managed ot output all the oldnews.headline
into
 my database but, I added a few more fields to the sql and now it had
 buggered it all up.
 This is bugging me,  any help will be very appreciated.
 Cheers
 Daz

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Quotes within a quoted value

2001-05-02 Thread Hayes, David

You could do a replace with quot;

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 01, 2001 4:22 PM
To: CF-Talk
Subject: Quotes within a quoted value


I'm trying to put a value into an input tag and am coming up with a minor
problem.  The value returned by the query is a meaurement like 12'3.  The
problem comes when the HTML tag is evaluated, it assumes the  after the 3
is the closing quote and doesn't display it.  Anyone know a way around this?
Here's the code:

INPUT TYPE=Text NAME=OAWft SIZE=20CFOUTPUT QUERY=equipitem
VALUE=#OAWft#/CFOUTPUT

Thanks,
Randy


Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: SQL troubles

2001-05-02 Thread Hayes, David

What's the problem?  

-Original Message-
From: Mark Adams [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 4:54 PM
To: CF-Talk
Subject: SQL troubles


I'm pulling out my hair can anyone see whats up here?


SELECT Assets.Course_ID, Assets.Module_ID, Assets.Lesson_ID,
Assets.Screen_ID, Assets.Form_ID, Assets.Asset_ID, Assets.Prose,
Assets.Reuse, Assets.Asset_Type, Screen.Reviewed FROM Assets INNER JOIN
Screen ON (Assets.Screen_ID = Screen.Screen_ID) AND (Assets.Lesson_ID =
Screen.Lesson_ID) AND (Assets.Module_ID = Screen.Module_ID) AND
(Assets.Course_ID = Screen.Course_ID) WHERE (((Screen.Reviewed)=True));

Running really low on hair at this point! AHH!!!

Thanks for any help! :)

-Mark
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: problem with list box update

2001-04-24 Thread Hayes, David

Mark,

You need to add SELECTED to the element in the drop-down which matches the
value in the record you are updating.

Here's some pseudo-code:

CFOUTPUT query=myQueryOfSelectValuesAndContents
option value=#myQueryOfSelectValuesAndContents.value# 
cfif myQueryOfSelectValuesAndContents.value EQ
myQueryOfTheRecordBeingUpdated.theFieldValueSELECTED/cfif
#myQueryOfSelectValuesAndContents.value#/option
/CFOUTPUT


-Original Message-
From: Marc Garrett [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 23, 2001 2:18 PM
To: CF-Talk
Subject: problem with list box update


I have an update page on which I need to show user friendly terms in a
select box, even though the information in the table is actually a code
number (e.g., the info is saved as 010-000 but the user should see
services.) The value from the select is then passed to a CFUPDATE on the
following page. I can get the update to work properly if the user changes
the value in the select box, but if she leaves the value unchanged the field
gets updated to the friendly word instead of leaving the code value
unchanged. 

Thanks for any assistance. I have included code below my sig.

Regards,

Marc Garrett

Here's the code that populates the select list:

select class=editBox name=fldCategory1
optioncfoutput query=category_1#fldCategory#/cfoutput/option
cfloop query=categories
option
value=cfoutput#fldCategoryID#/cfoutputcfoutput#fldCategory#/cfoutp
ut/option
/cfloop  
/select

Here's query category_1:

cfquery datasource=datasource name=category_1
SELECT
 tblContacts.fldContactID,
 tblContacts.fldCategory1,
 tblCategories.fldCategory,
 tblCategories.fldCategoryID
FROM
 tblContacts, tblCategories
WHERE
 tblContacts.fldContactID LIKE '#id#'
 AND tblCategories.fldCategoryID = tblContacts.fldCategory1
/cfquery

The update on the next page is simply:
cfupdate datasource=datasource tablename=tblContacts
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: CFSCRIPT Challenged ??

2001-04-23 Thread Hayes, David

for (I = 1 ; I LTE Info.RecordCount ; I = I + 1)
{
  I = I + 1 ;
  Student[I]= StructNew() ;
  Student[I].ID = Info.Student_ID ;
  Student[I].LN = Info.Last_Name ;
  Student[I].FN = Info.First_Name ;
}


You are incrementing I twice; once with the FOR statement and once with I
= I + 1.

-Original Message-
From: Gerry Pauline [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 23, 2001 10:40 AM
To: CF-Talk
Subject: CFSCRIPT Challenged ??


CFexperts:

Over the last few weeks there have been several notes concerning the
better capabilities of CFSCRIPT in 4.5.1, such as Michael D's notes on
the speed of loops and the recent discussion of looping over a query
with CFS.

So, I decided to give it try, but seem the be missing or
misunderstanding something ! I seem to be incorrectly addressing the
array elements in the WriteOutput statement, so they do not resolve
correctly, or at least that is what I think the error message is saying.

Would one of you CFSCRIPT experts point out what I'm doing wrong. Any
and all help will be gratefully appreciated !

Thank you.

-Gerry

Gerard T. Pauline
Mgr, Internet/DB Applications
Computer Systems, DoIT
Pace University 

PS:  I apologize for the length of this note.




The following CFML code, creating and outputing an array of structures
works perfectly fine:

CFQUERY NAME=Info DATASOURCE=LSN  MAXROWS=100

SELECT student_ID, last_name, first_name 
FROM Students
ORDER BY last_name, first_name;

/CFQUERY

CFSET Student = ArrayNew(1)
CFSET Idx = 0

!--- Load Array of Structures ---

CFLOOP QUERY=Info
CFSET Idx = Idx + 1 
CFSET Student[Idx]= StructNew()
CFSET Student[Idx].ID = Info.Student_ID
CFSET Student[Idx].LN = Info.Last_Name
CFSET Student[Idx].FN = Info.First_Name
/CFLOOP

!--- Generate The Output ---

TABLE BORDER=3
CFOUTPUT
CFLOOP INDEX=T FROM=1 TO=#ArrayLen(Student)#
TR
TD#Student[T].ID#/TD
TD#Student[T].LN#/TD
TD#Student[T].FN#/TD
/TR
/CFLOOP
/CFOUTPUT
/TABLE




However, my CFSCRIPT interpretation is not failing miserably:


CFQUERY NAME=Info DATASOURCE=LSN  MAXROWS=100

SELECT student_ID, last_name, first_name 
FROM Students
ORDER BY last_name, first_name;

/CFQUERY

CFSCRIPT

Student = ArrayNew(1) ;
Idx = 0 ;

/* Load The Array of Structures */

for (I = 1 ; I LTE Info.RecordCount ; I = I + 1)
{
  I = I + 1 ;
  Student[I]= StructNew() ;
  Student[I].ID = Info.Student_ID ;
  Student[I].LN = Info.Last_Name ;
  Student[I].FN = Info.First_Name ;
}

/* Generate The Output */

WriteOutput(TABLE BORDER='3') ;

for (T = 1 ; T LTE #ArrayLen(Student)# ; T = T + 1)
{
   WriteOutput(TR
TD#Student[T].ID#/TD
TD#Student[T].LN#/TD
TD#Student[T].FN#/TD
/TR) ;
}

WriteOutput(/TABLE) ;

/CFSCRIPT




This code fails with the following error messages; line 27 in the code
is the WriteOutput
statement that writes out the table row:

Error Occurred While Processing Request

 Error Diagnostic Information

 An error occurred while evaluating the expression: 


 Student = ArrayNew(1) ;
 Idx = 0 ;

 for (I = 1 ; I LTE Info.RecordCount ; I = I + 1)
 {
   I = I + 1 ;
   Student[I]= StructNew() ;
   Student[I].ID = Info.Student_ID ;
   Student[I].LN = Info.Last_Name ;
   Student[I].FN = Info.First_Name ;
 }

 WriteOutput() ;

 for (T = 1 ; T LTE #ArrayLen(Student)# ; T = T + 1)
 {
WriteOutput(
 
 
 
 ) ;
 }

 WriteOutput(
  #Student[T].ID#
   #Student[T].LN#
 #Student[T].FN#

 ) ;



 Error near line 27, column 5.


 The element at position 1 in dimension 1 of object Student cannot be
found. The object has elements in positions 1 through
 100. Please, modify the index expression.

 The error occurred while processing an element with a general
identifier of (CFSCRIPT), occupying document position (9:1)
 to (9:10) in the template file c:\inetpub\wwwroot\imap\stest2.cfm.

 Date/Time: 04/23/01 11:24:15
 Browser: Mozilla/4.7 [en] (WinNT; U)
 Remote Address: 172.17.140.10
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: 

RE: a week before...

2001-04-19 Thread Hayes, David

Look at DateAdd.

-Original Message-
From: Peter Benoit [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 19, 2001 1:19 PM
To: CF-Talk
Subject: a week before...


Hi,

I make a date using: cfset now = #CreateDate(url.year, url.month,
url.day)#

How can I find out what the day is 7 days prior?

TIA,
Pete
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Netscape equivalent of iframe

2001-04-18 Thread Hayes, David

Take a look at ILayer.

-Original Message-
From: Rosa, Issac [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 18, 2001 12:31 PM
To: CF-Talk
Subject: Netscape equivalent of iframe


Does anyone know of an equivalent in Netscape to the IE tag iframe.  NS6
supports the tag, but we are currently using NS4 as corp standard.  I need
to embed documents(.doc, .ppt, .xls, .pdf) that automatically load when the
page loads.  Any help or suggestions would be greatly appreciated.

Thank you,

 Issac Rosa
 
 IT - National Sales  Marketing
 OLAP Specialist Team Lead
 Ofc: 407-658-3111
 Cell: 407-342-0644
 Fax: 407-971-2374
 [EMAIL PROTECTED]

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: order by not working

2001-04-17 Thread Hayes, David

If you're trying to sort by the 4th item in the columns list, omit the
single quotes around 4.

Given that you are using the * to select all the columns, I suggest
specifying the column name in your order by clause.  The next programmer
(maybe you) who looks at the code will be glad you did; also, if the column
order in the table is changed, you'll get unexpected results.

-Original Message-
From: paul . [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 8:53 AM
To: CF-Talk
Subject: order by not working


Hi guys am using orderby to sort the fields to get the sort order
alphabetically am finding taht is not working please suggest
---
select * from UHC.PCA_SPECIAL where team_idx=1 and quarter_idx=5 ORDER BY
'4' ASC

the above is the SQL whats wrong
-paul


Get 250 color business cards for FREE!
http://businesscards.lycos.com/vp/fastpath/
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: (Easy SQL)

2001-04-17 Thread Hayes, David

Take a look at the convert function.

convert(char(8), signup_datetime, 1) as signup_date should give you what you
want.

-Original Message-
From: Eric Dawson [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 16, 2001 2:09 PM
To: CF-Talk
Subject: (Easy SQL)


I have a member table which contains
userid, signup_datetime

I want to create a daily summary of registrations.
select signup_datetime as justDatenotTime,count(userID) as NewMembers
from membertable
group by justDatenotTime

== * ==
I know this has to be simple, but I can't find the syntax. How do I drop the

time from a datetime field (SQL Server 7/2000/MSDE) so I can group by just 
the day?
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Weird CF Error

2001-04-12 Thread Hayes, David

As the error message suggests, it's a SQL Server error.  Look up "deadlock"
in SQL help.

-Original Message-
From: Edward Chanter [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 12, 2001 8:26 AM
To: CF-Talk
Subject: Weird CF Error


Has anyone seen these before:

~

Error Diagnostic Information
ODBC Error Code = 40001 (Serialization failure)

[Microsoft][ODBC SQL Server Driver][SQL Server]Your transaction (process ID
#15) was deadlocked with another process and has been chosen as the
deadlock victim. Rerun your transaction.

~~

I can't figure out what's causing it. Is it my dbase (SQL 7) or the CF
Server (4.01)

Any help would be most appreciated

best wishes,

  -= Ed


Problems cannot be solved at the same
level of awareness which created them.
   - Albert Einstein
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: SQL Returns

2001-04-12 Thread Hayes, David

Is your join correct? Should it, perhaps, be WHERE products.ItemID =
prodPics.itemID?
 Is there a 1 to 1 relationship between products and pics?  

-Original Message-
From: Alan Koenig [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 12, 2001 11:58 AM
To: CF-Talk
Subject: SQL Returns


I would like to refine my sql searches down.  From the following sql
statement I am recieving up to 12 returns of the same record.  How can I
make this so that there is only 1 return for each record?
 cfquery datasource="#datasource#" name="prodpage"
 SELECT  Products.ItemID, 
Products.SKU, Products.ItemName, 
Products.CategoryID, 
Products.SubCatID, 
Products.S_Description, 
Products.Description, 
Products.Price, 
Products.Weight, 
Products.A1, 
Products.A1Vals, 
Products.A2, 
Products.A2Vals, 
Products.Units, 
Products.Layout, 
Products.Key_Word, 
ProdPics.PicID, 
ProdPics.ItemPic, 
ProdPics.ItemPicLB, 
ProdPics.ItemPicF, 
ProdPics.ItemPicB
 FROMProducts, ProdPics 
 WHERE   Products.ItemID = ProdPics.PicID 
 AND   Description LIKE '%#form.keyword#%' 
 ORItemName LIKE '%#form.keyword#%' 
 AND   ItemID  1  
 ORDER BY ItemName
 /cfquery

TIA
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: cfoutput lists Alphabetically

2001-04-12 Thread Hayes, David

Try something like this:

SELECT LEFT(lastName,1) as Initial, lastname, firstname from myTable order
by Initial, lastname

Then you can use the grouping attribute on the Initial field.

CFOUTPUT query="myquery" group="Initial"
#initial#
CFOUTPUT
#lastname#, #firstName#
/CFOUTPUT
/CFOUTPUT

-Original Message-
From: Christine Kelley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 12, 2001 12:28 PM
To: CF-Talk
Subject: cfoutput lists Alphabetically



Hi!
   How do I output a whole list of names from a query 
grouped alphabetically?  Output example:

A
Allen, Bob
Ames, John

B
Book, Sam
Briant, Max

I'm thinking it's by somehow using the group attribute of 
the cfoutput tag or looping through the query, but I'm 
not sure exactly how to get these results.

Thank-you for any help!
   Christine
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Insert query? - nevermind

2001-04-12 Thread Hayes, David

This is analogous to the periodic "can I use javascript to set my cf
variables?" post - your CF object and your database are in different
"places".  The CF Query Object isn't going to be recognized by your database
application.

The tables don't have to be the same to use an INSERT...SELECT statement;
you specify which fields you want to use, and transform the data as needed
in the select statement.

You'll have to create multiple insert statements, whether you do it in CF or
do it in a stored procedure;  if you have a large number of records to
insert, you could output your Query Object to a formatted text file and
import directly into your db using a manual or automated process.

-Original Message-
From: Jon Hall [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 12, 2001 3:35 PM
To: CF-Talk
Subject: Re: Insert query? - nevermind


I just remembered I asked this question some time ago, and the answer was
no. I would really love to be able do this though...
cfinsert enhancement perhaps? Any technical reasons why this could not be
done?

jon
- Original Message -
From: "Jon Hall" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 12, 2001 4:30 PM
Subject: Insert query?


 I know it's possible to Insert a Select statement if the tables are
exactly
 the same, however is it possible to insert a CF queryset? Something
like...
 cfquery
 INSERT INTO Table(Columns,...)
 #GeneratedQuery#
 /cfquery

 jon

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: LOCKING

2001-04-11 Thread Hayes, David

I think you want to handle it more like this:

CFSET includeItP = false
CFLOCK SCOPE="SESSION" TYPE="READONLY" TIMEOUT="10"
CFIF session.value EQ 0
CFSET includeItP = true
/CFIF
/CFLOCK

CFIF includeItP
CFINCLUDE TEMPLATE="somecfml.cfm"
/CFIF


-Original Message-
From: Terry Bader [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 11, 2001 1:32 PM
To: CF-Talk
Subject: LOCKING


ok, question about locking

let's say I have code like this:

CFLOCK SCOPE="SESSION" TYPE="READONLY" TIMEOUT="10"
CFIF session.value EQ 0
CFINCLUDE TEMPLATE="somecfml.cfm"
/CFIF
/CFLOCK

And somecfml.cfm might possible need to write to the session scope.

Now, my question is, does the Lock in the calling cfm page follow down into
the included page?


just wondering because with a complex Conditional statement checking against
session variables, though you may be only reading from the session scope
while running the checks, you might just have to write to the session scope
somewhere inside
so if the lock does follow the INCLUDES then I guess the whole thing will
have to be EXECLUSIVELY locked...


Terry Bader
IT/Web Specialist
EDO Corp - Combat Systems
(757) 424-1004 ext 361 - Work
[EMAIL PROTECTED]   


(757)581-5981 - Mobile
[EMAIL PROTECTED]
icq: 5202487   aim: lv2bounce
http://www.cs.odu.edu/~bader
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: pull numbers from a string...

2001-04-11 Thread Hayes, David

Well, you should be able to do this using REFind.

For example, REFind("[0-9]*", myString , 1, true)

Look at the Help for REFind for handling the returned position and length of
the found item(s).  You'll have to figure out how to handle multiple numbers
in your string.


-Original Message-
From: Ethan Rosch [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 11, 2001 1:26 PM
To: CF-Talk
Subject: pull numbers from a string...


Hi all..

is there a funcion that wil strip everything out of a string except numbers?

ie.  The width of the box is 54"

and I want to set

CFSET Width = 54

something like

CFSET Width = NumberStrip("The Width of the box is 54")

#width# = 54

thanks in advance,

ethan
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: pull numbers from a string...

2001-04-11 Thread Hayes, David

grin OK, or you could do this:
#REReplaceNoCase("The width of the box is 54 ","[^0-9]","","ALL")#

-Original Message-
From: Ethan Rosch [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 11, 2001 1:26 PM
To: CF-Talk
Subject: pull numbers from a string...


Hi all..

is there a funcion that wil strip everything out of a string except numbers?

ie.  The width of the box is 54"

and I want to set

CFSET Width = 54

something like

CFSET Width = NumberStrip("The Width of the box is 54")

#width# = 54

thanks in advance,

ethan
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: insert help

2001-04-11 Thread Hayes, David

Double check your data types; for example, are Price, Size and Date really
text fields? (Its value is surrounded by single quotes in the statement.)

FYI - Try to name your date fields something other than "date".

-Original Message-
From: Jay Patton [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 11, 2001 2:33 PM
To: CF-Talk
Subject: insert help


.quick question...

does anyone see anything wrong w/ this insert statement?

cfset fileName = File.ServerFile
cfset ArtistID = Form.ArtistID
cfset TypeID = Form.TypeID
cfset ArtName = Form.RealName
cfset Price = Form.PriceFrame
cfset Date = Form.Date
  
cfquery name="AddImage"
 datasource="catlingalleries"
 dbtype="ODBC"
INSERT INTO OtherImages (SmallImage, ArtistID, TypeID, ArtName, Price, Size,
Date)
VALUES ('#fileName#', #ArtistID#, #TypeID#, '#RealName#', '#Price#',
'#Size#', '#Date#')
/cfquery


this is the error i get:

Error Diagnostic Information
ODBC Error Code = 37000 (Syntax error or access violation) 


[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO
statement. 



The error occurred while processing an element with a general identifier of
(CFQUERY), occupying document position (41:1) to (43:23).


Date/Time: 04/11/01 13:29:49
Browser: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)


Thanks in advance,

Jay Patton
Web Design / Application Design
Web Pro USA
p. 406.549.3337 ext. 203
p. 1.888.5WEBPRO ext. 203
e. [EMAIL PROTECTED]
url. www.webpro-usa.com
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: TOP function not performing

2001-04-10 Thread Hayes, David

Your ORDER BY field(s) should determine which records are returned; it your
example, you should be getting the 2 records with the highest end_date
value.

If you order by ID, you'll get 2 records with the lowest (sorted ascending)
or highest (sorted descending) ID.

Is end_date in fact a date field?  Or is it perhaps text?

-Original Message-
From: W Luke [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 10, 2001 4:00 PM
To: CF-Talk
Subject: Re: TOP function not performing



 try the same query with ORDER BY clauses in both the query and it's
 sub-query, if there is a sub-query.

ORDER BY - should I be ordering by ID in this case?


SELECT TOP 2 ID,Left(subject,20) AS subjects,end_date
FROM advert_details
ORDER BY end_date DESC

Will
--
[EMAIL PROTECTED] -=- www.lukrative.com
Local-Advertising -=- www.localbounty.com
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: update numeric SubString?

2001-04-10 Thread Hayes, David

You're using string operations on numeric values; I assume MS-SQL is able to
resolve the discrepancy, but ODBC can't.

This statement works through CF: SELECT LEFT(123456,3) + '1' + right(123456
, len(123456) -4) as test.

You could put the whole thing in a "CAST" statement, or you could use math
functions on your data:
select round(123456,-3) + (1*100) + (123456 % 100) as test





-Original Message-
From: Adrian Cesana [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 09, 2001 12:52 PM
To: CF-Talk
Subject: RE: update numeric SubString?


Anyone have any idea as to why this would result in a NULL when run thru
CF but when executed thru T-SQL works ok???


UPDATE mytable SET
switch =  left(switch, 3) + '1' + right(switch , len(switch) -4)
WHERE po = 236107

DB: SQL7 (switch = numeric field)
CF: 4.01


-Adrian
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Grouping Problem

2001-04-06 Thread Hayes, David

You'll need to have a computed column in your query which contains only the
day value.

In MS-SQL, you could use CONVERT(varchar(8),date,2) AS theDay

Then you can use "theDay" as your group column.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 06, 2001 2:07 PM
To: CF-Talk
Subject: Grouping Problem


I'm sure at least one of you people have had this problem, and i'm pulling
my hair out of here

I have a field which has a date/time value.

ie :  4/3/2001 12:00:00 PM

now there are tons of records for each day, but with different times.  

I am trying to output a list of the past 10 days.  Grouped by the Day only,
not the time.  

I've tried to actually format the date field in my [group] functions in the
cfoutput like this...

cfoutput query="information" group="DateFormat("#information.Date#",
"m/d/")#"

but this gives me an error saying that the information in the query does not
match within the loop

Can someone help me on this one?  I feel as though there is a really simple
answer, though i am clearly not seeing it

Thanks.

Kevin

~
Kevin Mansel
Web Developer
Fox Communications
[EMAIL PROTECTED]
DL : 425-649-1321
C : 425-346-7221
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Getting the value of a variable, once removed

2001-04-05 Thread Hayes, David

look at Evaluate.

#evaluate("#collist#")#

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 05, 2001 3:04 PM
To: CF-Talk
Subject: Getting the value of a variable, once removed



I have this:

   CFLOOP QUERY="GetFromUAT"
  CFLOOP QUERY="GetColList"
   CFIF (FindNoCase(COLLIST, GetFromUAT.Columnlist, 1) NEQ 0 OR
OPTIONAL IS 0) 
TD
 CFOUTPUT#COLLIST#/CFOUTPUT
/TD
   /CFIF
  /CFLOOP
   /CFLOOP

The #COLLIST# variable contains the name of another variable (a table column
name) which is the value I *really* need. I know this sounds confusing.
Say the current #COLLIST# value is ACCT. What I really need is the value of
#ACCT#, not ACCT (the value of #COLLIST#). Basically what I want to do is
find out what
columns were selected, and then display the value of the fields, not the
name of the column (which is what I get now).
The value of #GetFromUAT.Columnlist# would be something like this:
  ACCT,BMPRICE,BMREV,BMVOL,NETPRICE,NETREV,NETVOL
The value of #ACCT#, for example, would be something like this:
 493892847855103 ;
the value of #BMPRICE# would be 34.48, etc.
So, for each of the values in the #GetFromUAT.Columnlist#, I need the
underlying value -
(in the ACCT example, I actually need to return 493892847855103 (the
value of #ACCT#), not ACCT (the value of #COLLIST#).
I hope someone can understand this and help me out. I need a function like
#TheValueOfThisValue(Var)#.

Gina Shillitani
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Form Question

2001-04-04 Thread Hayes, David

Well, do create what you have in CF you would use Evaluate, e.g.,

myFormValue = evaluate("FORM.Field_name#counter#").




-Original Message-
From: Jason [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 04, 2001 3:02 PM
To: CF-Talk
Subject: Form Question


Maybe Im being dense today but I can do this in ASP pretty easy I just need
to know how to do it in CF.

I have a form that outputs a series of similar items that I allow the user
to change all at once with one form submit

example
INPUT TYPE="TEXT" NAME="FIELD_NAME#COUNTER#" VALUE="#FIELD_NAME#"
INPUT TYPE="TEXT" NAME="FIELD_ID#COUNTER#" VALUE="#ID#"

In ASP I am looping through the set like this

StrField_Name = Request.Form(Cstr("Field_name"  Varcounter))
IntField_ID = Request.Form(Cstr("Field_ID"  Varcounter))

THen I can do an update loop for however many of the same fields there are
like follows

Update Table
Set Field_Name = '"StrField_Name"'
Where ID = "IntField_ID"


So in effect getting Field_Name1 and Field_ID1, Field_Name2 and Field_ID2


Maybe Ive been switching back and forth between CF and ASP too much but I
can't recall the method to do this in CF. Must need more coffee.
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Strange SQL Error...

2001-04-04 Thread Hayes, David

Do you have an update trigger on the table?

-Original Message-
From: Lee Fuller [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 04, 2001 2:33 PM
To: CF-Talk
Subject: Strange SQL Error...


Has anyone seen this?

There are no "subqueries" going on in this SQL statement.. But yet we
get this error.

==

ODBC Error Code = 21000 () 
[Microsoft][ODBC SQL Server Driver][SQL Server]Subquery returned more
than 1 value. This is not permitted when the 
subquery follows =, !=, , = , , = or when the subquery is used as an
expression. 

SQL = "UPDATE tbl2inspectorformgeneration SET inspected = '5/5/1'" 

==

Clues anyone?

TTAIA!

Lee
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Displaying yes/no field dynamically in checkboxes?

2001-04-03 Thread Hayes, David

For a checkbox handling a yes/no column (or a bit column), you want the
value attribute of the checkbox to always be "yes" (or 1 or on or true or
whatever works for your db).

If the current value in the db is yes, you include include the Checked
attribute in your checkbox tag, e.g.

input type="checkbox" name="cabinPets" value="yes" CFIF cabinPets EQ
"yes""CHECKED"/CFIF 


If you set the value of the checkbox to the current db value, sometimes the
value of the checkbox will be "no", and if someone checks it, you would be
updating the db in exactly the wrong way.




-Original Message-
From: P@tty Ayers [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 03, 2001 8:22 AM
To: CF-Talk
Subject: Displaying yes/no field dynamically in checkboxes?


Friends,

I would much appreciate any help with a problem I'm stuck on.

I'm writing a page that will allow my client to edit a record. I've got it
so that the page queries the table and inserts the values from the record
specified by the numeric variable passed to it. The numeric fields, text
fields and memo fields appear, but I can't figure out how to make the
checkboxes display a check when the yes/no field is "yes".

Here's my code (below), such as it currently is. UltraDev wrote some of it
and I wrote the rest. The first few yes/no fields are "cabinHottub",
"cabinJettedtub", "cabinFireplace" and "cabinPets".

I would be grateful for any help; thanks very much in advance.

P@tty Ayers


cfinclude template="Connections/connAsheville.cfm"
cfparam name="cabintoedit" default="0"
cfparam name="rsEdit__varcabintoedit" default="#cabintoedit#"
cfquery name="rsEdit" datasource=#MM_connAsheville_DSN#
username=#MM_connAsheville_USERNAME# password=#MM_connAsheville_PASSWORD#
SELECT * FROM cabinQuery WHERE cabinID = #rsEdit__varcabintoedit#
/cfquery

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"

html
head
 titleEdit a Record Page/title
/head

body bgcolor="#FF"
!-- FORM SECTION --

cfoutput query = "rsEdit"

form name="add_form" method="post" action="editsuccess.cfm"

input type="hidden" name="cabinID" value="#cabinID#"

  table width="90%" border="1" cellspacing="0" cellpadding="5"
align="center" bordercolor="##CC"
tr
  tdCabin Name:/td
  td
input type="text" name="cabinName" maxlength="50"
value="#cabinName#"
  /td
  tdLocation (City):/td
  td
input type="text" name="cabinCity" maxlength="50"
value="#cabinCity#"
  /td
/tr
tr
  tdDistance from Asheville:/td
  td
input type="text" name="cabinDistance" maxlength="3" size="3"
value="#cabinDistance#"
  /td
  tdNumber of Bedrooms:/td
  td
input type="text" name="cabinBedrooms" maxlength="2" size="2"
value="#cabinBedrooms#"
  /td
/tr
tr
  tdNumber of Bathrooms:/td
  td
input type="text" name="cabinBathrooms" maxlength="2" size="2"
value="#cabinBathrooms#"
  /td
  tdSleeps:/td
  td
input type="text" name="cabinSleeps" maxlength="2" size="2"
value="#cabinSleeps#"
  /td
/tr
tr
  tdHot tub:/td
  td
input type="checkbox" name="cabinHottub" value="#cabinHottub#"
  /td
  tdJetted tub:/td
  td
input type="checkbox" name="cabinJettedtub"
value="#cabinJettedtub#"
  /td
/tr
tr
  tdFireplace:/td
  td
input type="checkbox" name="cabinFireplace"
value="#cabinFireplace#"
  /td
  tdPet-friendly:/td
  td
input type="checkbox" name="cabinPets" value="#cabinPets#"
  /td
/tr
tr
  tdNightly Rate:/td
  td $
input type="text" name="cabinNightly" size="4" maxlength="4"
value="#cabinNightly#"
  /td
  tdWeekly Rate:/td
  td $
input type="text" name="cabinWeekly" size="4" maxlength="4"
value="#cabinWeekly#"
  /td
/tr
tr
  tdBedroom 1:/td
  td
input type="text" name="cabinBedroom1" maxlength="50"
value="#cabinBedroom1#"
  /td
  tdBedroom 2:/td
  td
input type="text" name="cabinBedroom2" maxlength="50"
value="#cabinBedroom2#"
  /td
/tr
tr
  tdBedroom 3:/td
  td
input type="text" name="cabinBedroom3" maxlength="50"
value="#cabinBedroom3#"
  /td
  tdBedroom 4:/td
  td
input type="text" name="cabinBedroom4" maxlength="50"
value="#cabinBedroom4#"
  /td
/tr
tr
  tdBedroom 5:/td
  td
input type="text" name="cabinBedroom5" maxlength="50"
value="#cabinBedroom5#"
  /td
  tdSleep Sofa:/td
  td
input type="text" name="cabinSleepsofa" maxlength="50"
value="#cabinSleepsofa#"
  /td
/tr
tr
  tdLoft:/td
  td
input type="text" name="cabinLoft" maxlength="50"
value="#cabinLoft#"
  /td
  tdDishwasher:/td
  tdinput type="checkbox" name="cabinDishwasher"
value="#cabinDishwasher#"/td
/tr
tr
  tdMicrowave:/td
  tdinput type="checkbox" name="cabinMicrowave"
value="#cabinMicrowave#"/td
  tdAir 

RE: Need to find ISBN book database service with XML...

2001-04-03 Thread Hayes, David

Try the Library of Congress (http://catalog.loc.gov/help/command.htm); you
can do the search on ISBN.  You'll still need to parse out the data, but the
results layout should be more friendly than Amazon.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 03, 2001 1:15 PM
To: CF-Talk
Subject: Need to find ISBN book database service with XML...


Does anyone know of service that will return book titles, authors, and years
of publications given an ISBN number? Ideally with the results returned in
XML? Google searches have turned up zilch.

I've looked at Amazon's search result page, but parsing out those values
will be very difficult due to the relative lack of good delimiters.

tia,
Ron
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: query dates

2001-04-03 Thread Hayes, David

Don't use the quotes around your datepart in MS-SQL.   I just verified that
in the SQL Help; if you haven't installed it, you should.

-Original Message-
From: Diana Nichols [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 03, 2001 4:15 PM
To: CF-Talk
Subject: query dates


Can someone tell me how to specify part of a date in SQL 2000?

i.e. WHERE DatePart('m',eventdate) = #thismonth#

Worked fine in Access

Also, until I can get more SQL books, is there a good online resource for
stuff like this? All I can find are basic tutorials and performance tips

TIA!!


*
Diana Nichols
Webmistress
http://www.lavenderthreads.com
770.434.7374

"One man's magic is another man's engineering." ---Lazarus Long
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Simple validation

2001-04-03 Thread Hayes, David

Look at the CF isDate and isNumeric functions for server side validation;

For client side, here's some javascript for date format validation:

var dateObj = new Date(formInput);
if (isNaN(dateObj.valueOf()))
return false;

For numeric, use isNaN.


-Original Message-
From: Steven A. del Sol [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 03, 2001 5:04 PM
To: CF-Talk
Subject: Simple validation


I am in desperate need of a simple validation of two types of form fields.

1.   Date field (not a cfform just a plain form) - must validate that data 
entered is a date

2.  Number field (not a cfform just a plain form) - must validate that data 
entered is a number


Thanks

Stephanie
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Recursing with custom tags

2001-04-02 Thread Hayes, David

You need to take a look at GetBaseTagData and GetBaseTagList.

GetBaseTagData(tagname [, instancenumber ] )
 Returns an object that contains data (variables, scopes, etc.) from a
specified ancestor tag. By default the closest ancestor is returned. If
there is no ancestor by the specified name, or if the ancestor does not
expose any data (for example, CFIF), an exception will be thrown.


You can use GetBaseTagList (and ListValueCount) to find out how many
instances of the desired tag have been invoked.


-Original Message-
From: Reed Powell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 29, 2001 12:50 PM
To: CF-Talk
Subject: Recursing with custom tags


Somewhere in the back of my mind I remember hearing or reading about the
ability, without using session or client variables, to have a custom tag
that is in the middle of recursion access the variable space of the initial
caller.  Since each instance of the call to the custom tag creates it's own
space, using CALLER. doesn't work.  What I want to do is to continually add
to a set of results, on the initial calling page, of information that is
collecting at each level of the recursion.  I tried having each instance
write it's set of findings to a CALLER. variable, thinking that as the
recursion unwound those writes would gradually cascade upward towards the
original caller, but that didn't seem to work out the way I thought it
would.  I beat that code to death so badly, trying to get it to work, that
it's not in any condition to post here, but hopefully the idea of what I'm
after came across.

thanks,
-reed


Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Variables for shopping cart?

2001-04-02 Thread Hayes, David

Look at listFind and listDeleteAt

-Original Message-
From: W Luke [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 31, 2001 10:36 AM
To: CF-Talk
Subject: Variables for shopping cart?


Hi,

I'm using a basic client variable, client.adshop, to set a list of Advert
Numbers (eg 876,567,987,665) which are later cflooped to query the
Database.

They're part of a basic shopping cart, and I need to allow the removing of
items in that list/variable by the user.

Do I need an Array for this (not much experience with arrays) - or else how
can I do it?

Thanks

Will
--
[EMAIL PROTECTED] -=- www.lukrative.com
Local-Advertising -=- www.localbounty.com
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: CFMAIL drives me NUTS!

2001-03-30 Thread Hayes, David

What kind of behavior or error messages are you seeing?

-Original Message-
From: Mike Kear [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 30, 2001 9:12 AM
To: CF-Talk
Subject: CFMAIL drives me NUTS!




I have endless trouble with CFMail in a hosted environment - because I can't
get access to the undelivered mail and if the templates don't work all I get
is   - well nothing.

Can anyone tell me what's wrong with this code?  It's from a "tell a friend
about this site" form, which is supposed to pass 4 variables to the action
page (names and emails for each of sender and receiver).  Part of the action
page is two emails - one to the site visitor and one to their friend.

I don't think the problem is the tag itself, because the syntax of the
CFMAIL is the same as a working template which DOES send its email.  I
don't think it's the time line, because that works fine elsewhere on the
site too.

[first email]
cfmail to="#form.senderemail#" from="[EMAIL PROTECTED]"
subject="Told your friend about this site" server="xxx.xxx.xxx.xxx"
Apparently while visiting Bluegrass Australia
(http://bluegrass.org.au)
you used our form to invite a friend to visit us also.

Your friend's name and address is:
 #form.receivername#  at #form.receiveremail#

We very much appreciate your support.
---

This confirmation message was sent from:
http://bluegrass.org.au. Thank you.
Local Time: #dateformat(austime, "d /  / ")# at
#timeformat(austime, "h:mm tt")#
/cfmail
[end first email]



[second email]
!--- Send email to the friend   ---
cfmail to="#form.receiveremail#" from="[EMAIL PROTECTED]"
subject="Check out this site I found" server="xxx.xxx.xxx.xxx"

G'day #form.receivername# ... a message from
#form.sendername#


Right now I am visiting the site Bluegrass Australia - about
bluegrass and
acoustic music around Australia.  It has some great stuff that will probably
interest you too.  What's on around Australia,  details of new releases and
where you can get them, news about the bluegrass world.

So I suggest you use the URL below and have a look for
yourself. Email me
at #form.senderemail# and let me know what you think.

The site URL is: http://bluegrass.org.au


This e-mail was sent by #form.sendername#
IP address:  #Remote_addr#
Thank you.
Local Time: #dateformat(austime, "d /  / ")# at
#timeformat(austime, "h:mm tt")#
/cfmail
[end second email]


Could it be the fact that there are two emails on the one template? Is that
allowed?

Cheers,
Mike Kear
Windsor, NSW, Australia
AFP WebWorks






Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Subdirectories in CustomTags directory?

2001-03-30 Thread Hayes, David

You can put them in subdirectories, but I believe if you move an existing
custom tag from it's current path, CF won't find it until you restart.

Try creating a new custom tag in a subdirectory and calling it.

-Original Message-
From: Jamie Jackson [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 30, 2001 8:31 AM
To: CF-Talk
Subject: Subdirectories in CustomTags directory?


Hello,

Is there a way to call a custom tag that's in a subdirectory of ...
\CFUSION\CustomTags ? 

In other words, I want to organize some custom tags into
subdirectories:
\CFUSION\CustomTags\Site1\CT1.cfm (+ CT1a.cfm , CT1b,cfm, ...)
\CFUSION\CustomTags\Site2\CT2.cfm (+ CT2a.cfm, CT2b.cfm, ...)

I have tried this, but apparently, CF won't look in subdirectories of
the "CustomTags" directory. Is there a way to get CF to look in them?
Alternatively, is there another way to manage custom tags?

Thanks,
Jamie
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: insert

2001-03-30 Thread Hayes, David

You'll have to use a separate insert statement for each table, but they can
be done within the same CFQUERY block.  



-Original Message-
From: Jones, Becky [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 30, 2001 11:56 AM
To: CF-Talk
Subject: insert


is it possible to insert data into a database from a form field that would
insert the same data into 2 separate tables in the database?  
can i do this with one insert statement?


*
This e-mail, including any attachments, is intended for the 
receipt and use by the intended addressee(s), and may contain 
confidential and privileged information.  If you are not an intended 
recipient of this e-mail, you are hereby notified that any unauthorized 
use or distribution of this e-mail is strictly prohibited.
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Back-referencing after a REFind to set a variable?

2001-03-30 Thread Hayes, David

You want REReplaceNoCase.

-Original Message-
From: Jamie Jackson [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 30, 2001 1:50 PM
To: CF-Talk
Subject: Back-referencing after a REFind to set a variable?


Hi,

Is there a way to do this sort of thing?

cfscript
REFind("(before)(HeresTheStringIWant)(after)", myTargetString);
variables.foundstring = \2;
/cfscript

If not, what's the usual way to go about it? Seems like it could get
pretty ugly if there isn't a similar way.

Thanks,
Jamie
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Correct Me if im wrong. PLEASE!

2001-03-29 Thread Hayes, David

It creates a count, by contestantID,  of the number of records that have an
eventID in them, irrespective of the eventID value (or the distinctiveness
of it).

I would think the COUNT (DISTINCT EventID) would work; it did on my test.

Take a step back and just look at the results of 

SELECT ContestantID, count(eventID)
FROM ResultsManager
GROUP BY ContestantID


I would also take a look at the data in resultsManager.




-Original Message-
From: Jay Patton [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 29, 2001 11:20 AM
To: CF-Talk
Subject: Re: Correct Me if im wrong. PLEASE!


using HAVING COUNT (DISTINCT EventID) =2 still returns the same results as
w/o the DISTINCT part. doesn't make sense to me. this should return about 10
or 11 records and it returns close to 40 or 50.

Jay Patton
Web Design / Application Design
Web Pro USA
p. 406.549.3337 ext. 203
p. 1.888.5WEBPRO ext. 203
e. [EMAIL PROTECTED]
url. www.webpro-usa.com
- Original Message -
From: "Seva Petrov" [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Thursday, March 29, 2001 9:58 AM
Subject: RE: Correct Me if im wrong. PLEASE!


 Jay,

 Try the query with DISTINCT:

  SELECT ContestantID
  FROM ResultsManager
  GROUP BY ContestantID
  HAVING COUNT (DISTINCT EventID) = 2

 Cheers,
 Seva Petrov


  -Original Message-
  From: Jay Patton [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, March 29, 2001 11:37 AM
  To: CF-Talk
  Subject: Correct Me if im wrong. PLEASE!
 
 
  but
  this statement DOES Say "Select ONLY the ContestantID's that have
  2 or more DIFFERANT EventID's in the ResultsManager."
 
  SELECT ContestantID
  FROM ResultsManager
  GROUP BY ContestantID
  HAVING COUNT (EventID) = 2
 
  OR does this just pull all the contestantID's that are in there
  twice wether they have two DIFFERANT Event's or not?
  Could someone please help me out here. im trying to get ONLY
  Those that have two differant EventID's in this table.
 
  Thanks!,
 
  Jay Patton
  Web Design / Application Design
  Web Pro USA
  p. 406.549.3337 ext. 203
  p. 1.888.5WEBPRO ext. 203
  e. [EMAIL PROTECTED]
  url. www.webpro-usa.com
 
 

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Money DataType in SQL

2001-03-29 Thread Hayes, David

If you're asking about whether you need to put single quotes around the
value, the answer is no.  It's numeric, but is not limited to integers; they
can hold up to 4 decimal places.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 29, 2001 11:00 AM
To: CF-Talk
Subject: Money DataType in SQL


ok, just wondering if anyone knows thisI have a money datatype
fieldwould anyone happen to know if i should treat this datatype as a
string or an integer value?   (for inserting purposes)

thanks

kevin

~
Kevin Mansel
Web Developer
Fox Communications
[EMAIL PROTECTED]
DL : 425-649-1321
C : 425-346-7221
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Javascirpt problem on CF

2001-03-29 Thread Hayes, David

My first suggestion is that you debug your script by putting in alert
statements at various points.

For example,
if(byVal == true)
{
cnt_chk++;
alert(cnt_chk);
}




-Original Message-
From: PEREZ, RICHARD RINGO (SBCSI) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 29, 2001 11:33 AM
To: CF-Talk
Subject: Javascirpt problem on CF


This is my code with Javascript can you pelase help me figure out what's
wrong? i know that Javascript is a client side while CF is server side. Can
you please help me out to figure what changes do i need  to do on my code?

What i'm trying to do on my code is they need to click on the checkbox and i
will count how many checkboxes they already clicked on and they should have
a max of 13 clicks.

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"

html
head
title/title

link href="../Styles/css.css" rel="stylesheet" type="text/css"

script language="JavaScript"
var cnt_chk = 0;
var cnt_sel = 0;

function validate(obj){
len = parseFloat(obj.clen.value)

cnt_chk = 0
for(i=1; i=len; i++)
{
byVal = eval("obj.o" + i + ".checked")
if(byVal == true)
{
cnt_chk++
}
}

if(cnt_chk == 0)
{
alert("You must select a Candidate");
return false;
}

if(cnt_chk = 14 OR cnt_chk =12)
{
alert("You must select exactly 13 Candidates");
return false;
}
}

function fnCountNatin(obj){
cnt_sel = 0;
len = parseFloat(document.frmVote.clen.value)

for(i=1; i=len; i++)
{
byVal = eval("document.frmVote.o" + i + ".checked")
if(byVal == true)
{
cnt_sel++
}
}
document.frmvote.total_sel.value = cnt_sel++
}

function fnTotal(obj){
alert("number of Candidates selected: " + obj.value + " ")
return false;
}
/script

/head

body VLINK="#990099" LINK="Blue" TEXT="Black" ALINK="#7204C3" leftmargin=0
topmargin=0



cfquery name="GetC" datasource="xxx" dbtype="ODBC"
Select CID, CFirstName, CLastName, CNickName, CParty
From Candidate
/cfquery


form action="Update/add_vote_form.cfm" method="post" name="frmVote"
onSubmit="return validate(this)"

Unang Hakbang: Email input type="Text" name="Email" required="No" size="30"
maxlength="50"

P
Pangalawang Hakbang:br
table align="center"
tr
td/td
tdMga Kandidato/td
tdParty/td
/tr
cfoutput query="GetC"
tr
tdinput type="Checkbox" name="o#GetC.CID#" value="#GetC.CID#"
onClick="fnCountNatin(this)"/td
td#GetC.CFirstName# #GetC.CLastName# #GetC.CNickName#/td
td#GetC.CParty#/td
/tr
/cfoutput
/table
p
Pangatlong Hakbang:br
input type="hidden" name="clen" value="34"
Number of Candidates selected: 
input type="text" name="total_sel" maxlength="2" size="3" value="0"
onclick="return fnTotal(this)" onkeypress="javascript:return
fnTotal(this)"br
input type="submit" name="Submit" value=" Vote! "
/form
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: javascript add problem

2001-03-28 Thread Hayes, David

The form field values are text, so it's concatenating them.  Try the
javascript parseInt() function.

-Original Message-
From: Bernd VanSkiver [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 10:13 AM
To: CF-Talk
Subject: OT: javascript add problem


Sorry about the OT question, but am stumped as to why this won't work.
Trying
to use JavaScript to add the numbers in form fields together, instead of
adding them, it is appending them to each other.  Here is my code:

script language="JavaScript"
function AddToBasket()
{
OrderBooks.TotalQty.value = 0
OrderBooks.TotalQty.value = eval(OrderBooks.SW.value +
OrderBooks.SP.value)
}
/script

It is taking the value of OrderBooks.SP.value and apending it to
OrderBooks.SW.value instead of adding them.  For example,
OrderBooks.SW.value
= 3 and OrderBooks.SP.value = 5, I am getting 35 instead of 8.  Have tried
it
without the eval() in there and have set each form value equal to a
javascript
variable also with no change in results.

Bernd VanSkiver
[EMAIL PROTECTED]
ColdFusion Developer
ICQ #: 916324
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: javascript add problem

2001-03-28 Thread Hayes, David

++ is the increment operator.  

-Original Message-
From: Craig Dudley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 10:27 AM
To: CF-Talk
Subject: RE: javascript add problem


+ is for concatenating strings (spelling?)

++ will add them up i think.

-Original Message-
From: Bernd VanSkiver [mailto:[EMAIL PROTECTED]]
Sent: 28 March 2001 17:13
To: CF-Talk
Subject: OT: javascript add problem


Sorry about the OT question, but am stumped as to why this won't work.
Trying
to use JavaScript to add the numbers in form fields together, instead of
adding them, it is appending them to each other.  Here is my code:

script language="JavaScript"
function AddToBasket()
{
OrderBooks.TotalQty.value = 0
OrderBooks.TotalQty.value = eval(OrderBooks.SW.value +
OrderBooks.SP.value)
}
/script

It is taking the value of OrderBooks.SP.value and apending it to
OrderBooks.SW.value instead of adding them.  For example,
OrderBooks.SW.value
= 3 and OrderBooks.SP.value = 5, I am getting 35 instead of 8.  Have tried
it
without the eval() in there and have set each form value equal to a
javascript
variable also with no change in results.

Bernd VanSkiver
[EMAIL PROTECTED]
ColdFusion Developer
ICQ #: 916324
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Query boggle

2001-03-28 Thread Hayes, David

It's your FROM statement; you're not joining counties, districts, schools
and histories in any way, so you're getting a cartesian product set.

You need some join qualifiers along the likes of 

vv1_Counties INNER JOIN vv1_districts on vv1_districts.countyID =
vv1_Counties.countyID (or whatever field you're using to link those two).

-Original Message-
From: John Wilker [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 12:34 PM
To: CF-Talk
Subject: Query boggle


Hey guys and gals,

This is probably something I'm just not seeing clearly but the below
query is supposed to bring my back a count of records grouped by sex.
I've been staring at this query so long I'm not seeing anything. It finds
the right records. The data I have has a male and a female record and both
are found by this query. Yet when I output TotalPerGender I get 808233984

Much obliged.

CFQUERY DATASOURCE="#dbname#" NAME="qGetSectionTwo"
 SELECT
  COUNT(ChildIdentity.ChildID) AS TotalPerGender,
  ChildIdentity.ChildGender AS Gender
 FROM
  vvl_Counties ,
  vvl_districts,
  vvl_schools,
  ChildSchoolHistory CSH,
  ChildIdentity INNER JOIN ChildResidence ON ChildIdentity.ChildID =
ChildResidence.ChildID
 WHERE
  ChildIdentity.ChildID = CSH.ChildID
  AND Year(CSH.SchoolYearStartDate) BETWEEN #FORM.SchoolYear#
  AND CSH.schooltitle1 = 1!--- Not sure what value ---
  AND CSH.LastAttendDate IS NULL
  AND ChildResidence.ResidenceCounty = '#FORM.counties#'
 GROUP BY ChildIdentity.ChildGender
 ORDER BY ChildIdentity.ChildGender
/CFQUERY

J.

John Wilker
Web Applications Consultant
Allaire Certified ColdFusion Developer

Office: 909-943-8428
www.red-omega.com

15 people are known to have been crushed to death tilting soda
machines towards them in order to receive free soda.
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: query trouble

2001-03-28 Thread Hayes, David

Here are my standard steps for dealing with tough query problems:

1) View the CF-generated SQL statement by turning on debugging (or by just
cfoutput -ing the code instead of cfquery -ing it.

2) Look at the generated statement for obvious errors.

3) Try to run the generated SQL directly in your db, using some db tool
(e.g., Enterprise Manager)

4) Debug in the db, rather than in CF.  

-Original Message-
From: Jon Tillman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 12:43 PM
To: CF-Talk
Subject: query trouble


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I cannot for the life of me figure out what is wrong with this query. I am 
getting a Syntax Error or Access Violation Error:

cfquery name="setup" datasource="#application.dsn#"
INSERT INTO tblClient
(ClientTemplateID, ClientDomain, ClientDomainAction, 
ClientPackage, ClientTerms, ClientAddress_1,
ClientAddress_2, ClientCity, ClientState, ClientPostalCode,
ClientCountry, ClientPhone, ClientPhone_2, ClientEmail,
ClientFName, ClientMI, ClientLName, ClientCCNumber,
ClientCCExpire, ClientCCType, ClientComments,
ClientLogin, ClientPassword, ClientNew, ClientPrice)
VALUES (#session.TemplateID#, '#session.Domain#',
'#session.DomainAction#', #session.package#,
   '#session.terms#', '#session.Address_1#',
   '#session.Address_2#', '#session.City#',
   '#session.State#', #session.PostalCode#,
   '#session.Country#', #session.Phone#,
   #session.Phone2#, '#session.Email#',
   '#session.FName#', '#session.MI#',
   '#session.LName#', #Right(session.CCNumber, 4)#,
   #CreateODBCDateTime(CreateDate(session.CCexpYr,  
session.CCexpMo, 1))#,
   '#session.CCType#', '#session.Conmments#',
   '#session.Email#', '#password#',  'yes',
   #application.packageprice#)
/cfquery

Any help would be much appreciated.

- -- 
Jon Tillman
http://www.eruditum.org

Next thing they'll want is a word-processor that auto-updates quake 
mods, gets stock quotes, waters the office plants, walks their dog, 
orders a pizza, and is connected to a client/employee database.

-BEGIN PGP SIGNATURE-
Version: PGP 6.5.1i

iQA/AwUBOsIwxtga7tZtnIOtEQK4ZQCeLwq7ZA3B8XpP+dvqLXeieDZO9eYAniLZ
LWIucx8XRxjBQUe3/rvimj22
=EKA8
-END PGP SIGNATURE-
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Statement Help!!

2001-03-28 Thread Hayes, David

What results are you getting? 

Take a look at the DISTINCT COUNT function, instead of the COUNT function.
This should take care of the same eventID in different rodeos.

-Original Message-
From: Jay Patton [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 2:09 PM
To: CF-Talk
Subject: Statement Help!!


what i am trying to accomplish here is to show ONLY those contestants that
have 2 or more DIFFERANT EventID's in the ResultsManager (table in my SQL7
DB) (example: if they do the same event in every rodeo for the year they
should NOT show up, but if they do 2 or more they should) the following is
my query but something isnt working write and i cant seem to figure it out.
if anyone could help that would be great!

my query:

cfquery name="GetTotalPts"
 datasource="#datasource#"
 dbtype="ODBC"
 username="#username#"
 password="#password#"
SELECT ResultsManager.ContestantID, ResultsManager.EventID,
ContestantManager.FirstName, ContestantManager.LastName,
ContestantManager.City, ContestantManager.State, ContestantManager.Age, SUM
(ResultsManager.AdjPoints) as TOTALPTS,
COUNT (EventID)
FROM ResultsManager INNER JOIN ContestantManager ON
ResultsManager.ContestantID = ContestantManager.ContestantID
WHERE ContestantManager.Age  '51' AND ContestantManager.Gender = '1' AND
ResultsManager.NotAllAround = '0'
GROUP BY ResultsManager.ContestantID, ResultsManager.EventID,
ContestantManager.FirstName, ContestantManager.LastName,
ContestantManager.City, ContestantManager.State, ContestantManager.Age
HAVING COUNT (EventID) = 2
ORDER BY SUM (AdjPoints) DESC
/cfquery

Thanks in advance,

Jay Patton
Web Design / Application Design
Web Pro USA
p. 406.549.3337 ext. 203
p. 1.888.5WEBPRO ext. 203
e. [EMAIL PROTECTED]
url. www.webpro-usa.com
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: SQL Question (Access)

2001-03-28 Thread Hayes, David

You could do a subquery on the answers table:

SELECT 
 HNTQuestion.QuestionID,
 HNTQuestion.Category,
 HNTQuestion.QuestionShort,
 HNTCategories.HNTCategoryID,
 HNTCategories.HNTCategoryName
  
FROM  HNTQuestion, HNTCategories
 
   WHERE HNTQuestion.Category  = HNTCategories.HNTCategoryID  

*AND HNTQuestion.QuestionID IN 
(SELECT QuestionID FROM answersTable)


   ORDER BY HNTQuestion.Category, HNTQuestion.QuestionShort

-Original Message-
From: Michael Kear [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 4:33 PM
To: CF-Talk
Subject: OT: SQL Question (Access)


I'm sorry if this is off-topic, but I'm hoping for some help from people
who know more about SQL than I do ... 

I have a hints'n'tips section on one of my sites, and it has 3 tables -
tblCategories, tblQuestions and tblAnswers.  I want to have an index page
that lists the questions in their categories, so you click on the question
and a window opens with all the answers to that question.

Here's the bit I am having trouble with .. A few questions don't have any
answers yet - for example some haven't been loaded up yet.   How do I get
SQL to retrieve only the questions that have answers in the Answers table,
leaving out any questions that have no answers?

Here's the SQL I'm using now, that returns all the questions (if it's
relevant here, the database is Access2000): 

cfquery name="getquestions" datasource="#dsn#" 
SELECT 
 HNTQuestion.QuestionID,
 HNTQuestion.Category,
 HNTQuestion.QuestionShort,
 HNTCategories.HNTCategoryID,
 HNTCategories.HNTCategoryName
  
FROM  HNTQuestion, HNTCategories
 
   WHERE HNTQuestion.Category  = HNTCategories.HNTCategoryID   
 
   ORDER BY HNTQuestion.Category, HNTQuestion.QuestionShort
/cfquery


An answer is linked to its associated question with a field ANSQuestionID
in the table tblAnswers which has the same value as the field
HNTQuestion.QuestionID.
  

Can anyone help me please?

Cheers,
Mike Kear
Windsor, NSW, Australia
AFP Webworks.
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: T-SQL and single quote lists

2001-03-28 Thread Hayes, David

What results are you getting?

-Original Message-
From: Jeff Gombala [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 5:43 PM
To: CF-Talk
Subject: T-SQL and single quote lists


Is it possible to pass a single quoted list into a SQL server stored
procedure for use in an "IN" statement:
see the following code...

***
PROCEDURE
***

CREATE PROCEDURE spMEPFundList
@mepid varchar(3),
@CustList varchar(400),
@StandList varchar(400)
AS

Select tFund_name, tTicker, Cust=0
from tblFunds
where tTicker in (@StandList)
UNION
Select tFund_Name, tTicker, Cust=1
from tblCustomFunds
where tTicker in (@CustList)
and txtMEP = @mepid


CF CODE


cfset CustList = "'AFAF', 'AGAX'"

cfstoredproc procedure="insertUser" ...
cfprocparam 
cfprocparam type="IN" cfsqltype="CF_SQL_VARCHAR"
dbvarname="@CustList" value="#PreserveSingleQuotes(request.CustList)#"
null="no"
cfprocparam 
/cfstoredproc
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Using a SQL query to drive another SQL query

2001-03-28 Thread Hayes, David

I'm not clear what you're trying to accomplish, but you can use what are
called subqueries in your WHERE clause, e.g.

SELECT  ID,SEQUENCE,TEXT
FROMMyOtherSource
WHERE   ID  IN 
(SELECT  ID
FROMMySource
WHERE   NAME LIKE '#FORM.junk1#%')


The other thing you can do is use the VALUELIST function, e.g.,

SELECT  ID,SEQUENCE,TEXT
FROMMyOtherSource
WHERE   ID  IN (#valueList(firstQueryName.ID)#)


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 5:50 PM
To: CF-Talk
Subject: Using a SQL query to drive another SQL query


I'm running into a bit of a problem making my code work; any suggestions?

I'm trying to get data from one SQL routine, and then feed that data into
another.

Here is the first one:

SELECT  ID, NAME
FROMMySource
WHERE   NAME LIKE '#FORM.junk1#%'

I'm then loading the ID values into an array, and trying to feed that array
into
another SQL query, without any success.

CFSET Sequence = "1"  
CFSET queryArray = ArrayNew(1)

CFLOOP query ="GetList"
CFSET myArray[#Sequence#] = #ID#
CFSET Sequence = IncrementValue(Sequence)
/cfloop

SELECT  ID,SEQUENCE,TEXT
FROMMyOtherSource
WHERE   ID = '#Current#'

CFLOOP INDEX="Counter" 
FROM = "1" TO = "#getList.RecordCount#"
CFSET Current = #getList[Counter]#

Unfortunately, I get

Error resolving parameter CURRENT

which leads me to believe that CF is trying to use the CURRENT variable
before
the CFLOOP happens.

I apologize if I'm making a stupid mistake here; I'm still fairly new at CF,
and
tackling a few projects that I'm willing to admit are over my head (I was
teased
by a friend last week--"Your program has nested CFLOOPs, and you're using
CFQUERY and SQL to go get the data you want, but you don't know how to use a
BR tag...??).  Any advice would be appreciated.

Allan Davis
[EMAIL PROTECTED]


Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: T-SQL and single quote lists

2001-03-28 Thread Hayes, David

OK, so there's some difference between your hardcoded list and what
#PreserveSingleQuotes(request.CustList)# evaluates to.  Did you output it to
the screen?  

I notice your code includes

cfset CustList = "'AFAF', 'AGAX'"

but in the cfprocparam tag you specifically reference request.CustList;
are they the same?


Have you turned on debugging to see what SQL is being sent to your db?

-Original Message-
From: Jeff Gombala [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 5:56 PM
To: CF-Talk
Subject: Re: T-SQL and single quote lists


If I hard code the list into the "IN" statement I get the results I am
looking for it I use the parameter in the "IN" statement as such "IN
(@CustList)" the query returns nothing not even any errors.  It is almost
like @CustList is not being evaluated inside the ().


----- Original Message -
From: "Hayes, David" [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Wednesday, March 28, 2001 6:47 PM
Subject: RE: T-SQL and single quote lists


 What results are you getting?

 -Original Message-
 From: Jeff Gombala [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, March 28, 2001 5:43 PM
 To: CF-Talk
 Subject: T-SQL and single quote lists


 Is it possible to pass a single quoted list into a SQL server stored
 procedure for use in an "IN" statement:
 see the following code...

 ***
 PROCEDURE
 ***

 CREATE PROCEDURE spMEPFundList
 @mepid varchar(3),
 @CustList varchar(400),
 @StandList varchar(400)
 AS

 Select tFund_name, tTicker, Cust=0
 from tblFunds
 where tTicker in (@StandList)
 UNION
 Select tFund_Name, tTicker, Cust=1
 from tblCustomFunds
 where tTicker in (@CustList)
 and txtMEP = @mepid

 
 CF CODE
 

 cfset CustList = "'AFAF', 'AGAX'"

 cfstoredproc procedure="insertUser" ...
 cfprocparam 
 cfprocparam type="IN" cfsqltype="CF_SQL_VARCHAR"
 dbvarname="@CustList" value="#PreserveSingleQuotes(request.CustList)#"
 null="no"
 cfprocparam 
 /cfstoredproc

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: javascript to set cfvariable?

2001-03-28 Thread Hayes, David

No you can't, Ethan.  Here's the standard answer:

Javascript is client side, Cold Fusion is server side.

To get information from the client browser to the Cold Fusion server, you'll
need to pass the information as form or url parameters.



-Original Message-
From: Ethan Rosch [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 6:11 PM
To: CF-Talk
Subject: javascript to set cfvariable?


can I use javacript to set a cfvariable?

eg.

onChange='CFSET var=1'



thanks in advance...

e
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: javascript to set cfvariable?

2001-03-28 Thread Hayes, David

grin Well, I figured that one could wait a while; besides I've had some
problems with it on certain platforms.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 6:34 PM
To: CF-Talk
Subject: RE: javascript to set cfvariable?


 No you can't, Ethan.  Here's the standard answer:

 Javascript is client side, Cold Fusion is server side.

 To get information from the client browser to the Cold Fusion
 server, you'll
 need to pass the information as form or url parameters.

Or in a gif data-pipe if you want to get tricky:

http://www.depressedpress.com/DepressedPress/Content/ColdFusion/Essays/GIFAs
Pipe/

(watch the line wrap)

:)
-ron
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Title Case for proper names.......

2001-03-27 Thread Hayes, David

Well, another (easier?) way to handle it would be to think of your input
string as a space delimited list; you can then process each word easily.


CFSET skipAllCapsWordsP = true
CFSET myString = "fourscore and seven years ago at IBM"
CFSET mySkipList = "and,the,a,in,at"
CFSET myFormattedString = myString


CFLOOP INDEX="loopCounter" FROM="1" TO="#listLen(myString,' ')#" STEP="1"
CFSET myWord = listGetAt(myString,loopCounter," ")
CFSET skipThisWordP = false

CFIF skipAllCapsWordsP
!--- skip "all cap" words ---
CFIF Compare(ucase(myWord),myWord) IS 0
CFSET skipThisWordP = true
/CFIF
/CFIF

!--- capitalize the first word, even if it's in the skip list ---
CFIF NOT skipThisWordP AND listFind(mySkipList,myWord) AND
loopCounter NEQ 1
CFSET skipThisWordP = true
/CFIF


CFIF NOT skipThisWordP
CFSET myFormattedWord = ucase(left(myWord,1)) 
lcase(mid(myWord,2,len(myWord)))
CFSET myFormattedString = listSetAt(myFormattedString,
loopCounter, myFormattedWord, " ")
/CFIF
/CFLOOP


CFOUTPUT#myFormattedString#/CFOUTPUT 

-Original Message-
From: Richard Kuryk [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 27, 2001 10:37 AM
To: CF-Talk
Subject: RE: Title Case for proper names...


Here is a title case custom tag that I wrote.  I realized that the regular
expressions in cold fusion just aren't all as powerful as in perl.  If
anyone has any suggestions on ways to optimize this even more please let me
know.

Thanks

Rich


CFPARAM name="Attributes.original" default=""
CFPARAM name="Attributes.searchlist" default=""
CFPARAM name="Attributes.replacevaluelist" default=""
CFSCRIPT
cur_pos = 2;
new_string = Ucase(Left(Attributes.original,1));
do {
st = REFind("([[:space:]]+[[:alpha:]])",
Attributes.original, cur_pos, "TRUE" );
if ( st.pos[1] GT 0 ) {
new_string = new_string 
LCASE(Mid(Attributes.original, cur_pos, (st.pos[1]-cur_pos)));
new_string = new_string 
UCASE(Mid(Attributes.original, st.pos[1], st.len[1]));
} else {
new_string = new_string 
LCASE(Right(Attributes.original, (len(Attributes.original)-cur_pos)+1));
}
cur_pos = st.pos[1] + st.len[1];
 } while ( cur_pos is NOT 0 );
 if ( ListLen( Attributes.searchlist ) GT 0 ) {
new_string = ReplaceList(new_string, Attributes.searchlist,
Attributes.replacevaluelist);
 }
 Caller.output=new_string;
/CFSCRIPT
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: last 7 days

2001-03-27 Thread Hayes, David

In MS-SQL you could use:

WHERE DATEDIFF(d,cast(cast(tmonth as varchar) + '/' + cast(tday as varchar)
+ '/' + cast(tyear as varchar) as datetime),getDate()) = 7

-Original Message-
From: Peter Benoit [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 27, 2001 12:20 PM
To: CF-Talk
Subject: last 7 days


Trying to post some results to a CF report that I built, but I can't think
of a way to poll the database for any records on the last 7 days to present
in the report.

so far I have:

cfquery name="dayData" datasource="#DSN#"
   SELECT *
   FROM outageReport
   WHERE tMonth LIKE '#url.month#' 
   AND tDay LIKE !-- ok, this is the part I can't figure out... I need to
get the last 7 days including today here... --
/cfquery

I just save the day/month/year info in different columns in the database, so
tDay would look like 27 for today, tMonth 3, tYear 2001.

thanks for any help
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: SQL Business Dates

2001-03-27 Thread Hayes, David

Look at the DATEPART function.

-Original Message-
From: Alex [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 27, 2001 1:31 PM
To: CF-Talk
Subject: SQL Business Dates


I have a query ...
SELECT AVG(DATEDIFF(minute, dateasgn, datecomp)) AS diff
FROM tblprob
WHERE priority = 'urgent'
AND datecomp IS NOT NULL
AND status = 'closed'
AND dateasgn = '#form.startdate#' 
AND dateasgn = '#form.endDate#'

but I only want the business dates (no weekends or nights; just 9AM to 5PM
Mon
to Fri)

This is in SQLServer. Any help appreciated.
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Statement Question/Help

2001-03-26 Thread Hayes, David

Use a HAVING clause before your ORDER BY clause, e.g. "having
count(contestantID) = 2"

-Original Message-
From: Jay Patton [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 11:11 AM
To: CF-Talk
Subject: Statement Question/Help


Good day all,
I was wondering if anyone could help me with this. i have a statement shown
below that works great. however i was wondering if someone might give me an
idea of how to do this: i need to display ONLY the contestants that show up
in the ResultsManager (this is a table) More than once. the following query
displays everyone (with the proper gender that is) but im haveing problems
getting it to show just the contestants that have 2 or more events recorded
in the ResultsManager. should i edit this query or should i do another one
and 'tie' them to gether? im kinda at a loss here, not sure what to do. any
help would be greatly appreciatted. here is my statement

cfquery name="GetTotalPts"
 datasource="#datasource#"
 dbtype="ODBC"
 username="#username#"
 password="#password#"
SELECT ResultsManager.ContestantID, ContestantManager.FirstName,
ContestantManager.LastName, ContestantManager.City, ContestantManager.State,
SUM (ResultsManager.AdjPoints) as TOTALPTS
FROM ResultsManager INNER JOIN ContestantManager ON
ResultsManager.ContestantID = ContestantManager.ContestantID
WHERE ContestantManager.Gender = '2' AND ResultsManager.NotAllAround = '0'
GROUP BY ResultsManager.ContestantID, ContestantManager.FirstName,
ContestantManager.LastName, ContestantManager.City, ContestantManager.State
ORDER BY SUM (AdjPoints) DESC
/cfquery

Thanks a TON!,

Jay Patton
Web Design / Application Design
Web Pro USA
p. 406.549.3337 ext. 203
p. 1.888.5WEBPRO ext. 203
e. [EMAIL PROTECTED]
url. www.webpro-usa.com
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: SQL Joins with multiple databases

2001-03-26 Thread Hayes, David

Here's some info on doing it in MS-SQL.  From Help on "FROM":

table_source

Specifies a table or view, both with or without an alias, to use in the
Transact-SQL statement. A maximum of 256 tables can be used in the
statement. A table variable may be specified as a table source. 

If the table or view exists in another database on the same computer running
Microsoft® SQL Server(tm), use a fully qualified name in the form
database.owner.object_name. If the table or view exists outside the local
server on a linked server, use a four-part name in the form
linked_server.catalog.schema.object. A four-part table (or view) name
constructed using the OPENDATASOURCE function as the server part of the name
also may be used to specify the table source. For more information about the
function, see OPENDATASOURCE.


-Original Message-
From: Shark [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 1:20 PM
To: CF-Talk
Subject: SQL Joins with multiple databases


Anyone know a way to do joins using SQL on more than one database? Rather
than scripting.

Thanks, Mark
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: CFFILE ACTION=copy and NAMECONFLICT

2001-03-23 Thread Hayes, David

I believe you'll have to check for the existence of the file name using
CFDIRECTORY first.

-Original Message-
From: Aidan Whitehall [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 23, 2001 9:08 AM
To: CF-Talk
Subject: RE: CFFILE ACTION="copy" and NAMECONFLICT


 Can't you use the 'MAKEUNIQUE' attribute with the CFFILE tag?

That's what I'd done - added NAMECONFLICT="makeunique" and ColdFurion threw
the error message pasted into the last post.




-- 
Aidan Whitehall [EMAIL PROTECTED]
Netshopper UK Ltd
Advanced Web Solutions  Services

http://www.netshopperuk.com/
Telephone +44 (01744) 648650
Fax +44 (01744) 648651
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Regular expression Help

2001-03-23 Thread Hayes, David

This works.

CFSET theString = "meta name=""pubdate"" content=""Fri, 23 Mar 2001
07:00:00 GMT"""
CFSET st = reFindNoCase("(content="")(.*)(GMT"")",theString,1,"TRUE")
CFOUTPUT#mid(theString,st.pos[3],st.len[3])#/CFOUTPUT


The two pieces are:

1) Creating the regularExpression

2) understanding the use of the "return subexpressions" attribute of reFind;
check the documentation.  I learned something just now about using it with a
paren-ed regular expression.


-Original Message-
From: Mallory Woods [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 23, 2001 10:17 AM
To: CF-Talk
Subject: Regular expression Help


Greetings All,

I am in the process of developing a small headache with Regular
Expressions...

I have looked at all of the examples I could find on the archives of this
mailing list and other web
pages but I still just don't get it.. I think I will pickup the O'Reilly
book that I have seen at another job before
on regular expressions but for now I am asking the list for help..

What I am trying to do is parse through an HTML source page an look for a
specfic string.. for example..

meta name="pubdate" content="Fri, 23 Mar 2001 07:00:00 GMT"

I would like to grab everything from this string from " to GMT"

Thanks in Advance...

Mallory Woods



This email and any files transmitted with it are confidential and are
intended solely for the use of the individual or entity to which they are
addressed.  If you are not the intended recipient or the person responsible
for delivering the email to the intended recipient, be advised that you have
received this email and any such files in error and that any use,
dissemination, forwarding, printing or copying of this email and/or any such
files is strictly prohibited.  If you have received this email in error
please immediately notify [EMAIL PROTECTED] and destroy the original
message and any such files.
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Finding a space in a string..

2001-03-23 Thread Hayes, David

Take the quotes off of tempdefendant; it's checking the string (which
doesn't have any spaces) rather than a variable.

-Original Message-
From: Angél Stewart [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 23, 2001 10:27 AM
To: CF-Talk
Subject: Finding a space in a string..


Hi dee ho all,

Would this find a space in a string?

CFSET pos= #Find(Chr(20),'tempdefendant')#

Because..it ain't working for some reason.
I also tried 

CFSET pos= #Find(' ','tempdefendant')#

BUt that results in POS being 0 all the time.

-Gel
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Why wont this advance to the next record

2001-03-23 Thread Hayes, David

href="cfoutput-default2.cfm..." looks odd; is cfoutput really part of your
file name?

-Original Message-
From: Michael [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 23, 2001 11:43 AM
To: CF-Talk
Subject: Why wont this advance to the next record


Appreciate it someone could tell me why this wont advance to the next
record,  keep getting 404 error object not found

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"

cfparam name="firstrow" default="1"
CFIF IsDefined("URL.first")
cfset firstrow = url.first
/CFIF
Cfset startnextpage = Firstrow + 1

CFPARAM Name="ID" Default=1
HTML
HEAD


cfquery name="selectcandidate" datasource="interview" dbtype="ODBC"
SELECT  ID, EmpCandidate, SKillBackground, Status, Recruiter, Profile
FROMinterview
WHERE ID=#ID#
/cfquery

TITLEInterview Candidates/TITLE
/HEAD

BODY bgcolor="6699ff"
!--- include toolbar.cfm---
cfinclude template="Toolbar.cfm"

cfoutput query="Selectcandidate" startrow="#firstrow#" maxrows="1"
table cellpadding="10"
tr
 tdID/tdbr
 td#id#/tdbr
/tr
tr
 tdCandidate Name/tdbr
 td#EmpCandidate#/tdbr
/tr
tr
 tdSkill Background/td
 td#SKillBackground#/td
/tr
tr
 tdStatus/td
 td#Status#/td
/tr
tr
 tdRecruiter/td
 td#Recruiter#/td
/tr
/table
BRBR
a href="cfoutput-default2.cfm?First=#StartNextPage#"Next Record/a
/cfoutput
/body

Thank You
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: embedding variable name

2001-03-23 Thread Hayes, David

Try #evaluate(DE(theLinkString))#

-Original Message-
From: Toby Tremayne [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 9:38 PM
To: CF-Talk
Subject: embedding variable name


I'm sure someone must have tried this before me - I can't figure out a way
to do it.

I have a facility on my forum which allows people to select a poem from the
library, and insert a link to it into the message text.  So when someone
reads the message, they can click on the link and be taken directly to that
poem's page.

The problem with this is that obviously all links need to have urltoken
appended to them.  However I can't find a way to insert the variable name
into the url that gets saved in the message text, 

This is what the links look like when they get embedded:

a href="#self#?fuseaction=lib.selectionpoem_id=914#urltoken#"

obviously I'm escaping the hashes - so it saves exactly the above text into
the database.  But when I display it is displays exactly like that too -
keeping the hashes in the url, so the link is treated as an anchor!!!

I need it to read these variables when the message is displayed becsause
obviously the variable values wil change from person to person.

Any ideas?


Toby Tremayne
Code Poet and Zen Master of the Heavy Sleep
Show Ads Interactive
359 Plummer St
Port Melbourne
VIC 3207
P +61 3 9245 1247
F +61 3 9646 9814
ICQ UIN  13107913
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Why wont this advance to the next record

2001-03-23 Thread Hayes, David

A few thoughts:

1) Cache the query so you're not calling the db every time the page loads,

2) Turn on debugging and look at the SQL statement that's actually being
generated,

3) remove CFPARAM Name="ID" Default=1; I believe you're grabbing the same
one record from the db every time.  There is no second row in your query
object.



-Original Message-
From: Michael [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 23, 2001 2:56 PM
To: CF-Talk
Subject: Re: Why wont this advance to the next record


This is the latest and greatest and it still does not work properly shows
the first record and then goes to a blank screen.

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"

cfparam name="firstrow" default="1"
CFIF IsDefined("URL.first")
 cfset firstrow = url.first
/CFIF

Cfset startnextpage = Firstrow + 1

CFPARAM Name="ID" Default=1
HTML
HEAD


cfquery name="selectcandidate" datasource="interview" dbtype="ODBC"
SELECT  ID, EmpCandidate, SKillBackground, Status, Recruiter, Profile
FROMinterview
WHERE ID=#ID#
/cfquery

TITLEInterview Candidates/TITLE
/HEAD

BODY bgcolor="6699ff"
!--- include toolbar.cfm---
cfinclude template="Toolbar.cfm"

cfoutput query="Selectcandidate" startrow="#firstrow#" maxrows="1"
table cellpadding="10"
tr
 tdID/tdbr
 td#id#/tdbr
/tr
tr
 tdCandidate Name/tdbr
 td#EmpCandidate#/tdbr
/tr
tr
 tdSkill Background/td
 td#SKillBackground#/td
/tr
tr
 tdStatus/td
 td#Status#/td
/tr
tr
 tdRecruiter/td
 td#Recruiter#/td
/tr
tr
 td valign="top"Profile/td
 tdtextarea cols="50" rows="5" name="Profile"#profile#/textarea/td
/tr
/table
BRBR/cfoutput
cfoutput
a href="default2.cfm?First=#StartNextPage#"Next Record/a
/cfoutput
/html
/body

"Keith C. Ivey" [EMAIL PROTECTED] wrote in message
3ABB6398.2825.165E1F@localhost">news:3ABB6398.2825.165E1F@localhost...
 On 23 Mar 2001, at 13:49, Michael wrote:

  No its name is default2.cfm,  it will show me the first record
  but after that I get a 404 error.

 But this is what you had in the code you posted:

  a href="cfoutput-default2.cfm?First=#StartNextPage#"Next
  Record/a

 If it's called default2.cfm, why are you linking to it as
 cfoutput-default2.cfm?

 Keith C. Ivey [EMAIL PROTECTED]
 Webmaster, EEI Communications
 66 Canal Center Plaza, Suite 200
 Alexandria, VA  22314
 Telephone:  703-683-0683
 Fax:  703-683-4915
 Web Site:  http://www.eeicommunications.com


~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: pulling CF code from a db an having that code parse in page

2001-03-23 Thread Hayes, David

Why store the "cfinclude template=" in the db?  Just store the actual
template name in the db.

-Original Message-
From: Robert Long [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 23, 2001 4:08 PM
To: CF-Talk
Subject: pulling CF code from a db an having that code parse in page


Here's one...

I would like to allow a user to insert cf code, namely cfinclude
template="SomeTemplate.cfm" into a
database field. Then I would like to have another template query the
database and pull out the code
and parse the cf code and pull in the template before sending it to the
browser.

What am I overlooking?

Here's some of the code I've tried.

cfquery datasource="#variables.dsn#" name="qryAdditionalCode"
select txtAdditionalContent 
/cfquery

cfoutput
#qryAddtionalCode.txtAdditionalContent# brbr
#evaluate(de(qryAddtionalCode.txtAdditionalContent)#
/cfoutput

Neither one of the outputs works as desired, nor do they cause an error but
it doesn't display the contents
of the requested include file. Rather, if I view the source in the browser,
I see 
cfinclude template="SomeTemplate.cfm" 

Any suggestions?

Thanks in advance,
Robert
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Newbie question - query by month

2001-03-22 Thread Hayes, David

In SQL datepart function, you don't need quotes around the "datepart"
argument, and since it's a numeric value, you don't need quotes around
#month#.

-Original Message-
From: Francis, Jennifer [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 3:12 PM
To: CF-Talk
Subject: Newbie question - query by month


I have a date field (completedate) stored in my database.  I want to be able
to pull out all of the records by a selected month for a month-end report.  

Is there an easy way of doing this?  I've tried 

where datepart('m', completedate)='#month#' 

but I keep getting an "invalid column name" error.

Any help would be MUCH appreciated...  

Jennifer Francis
ATT Wireless
Training Development  Design
[EMAIL PROTECTED]
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Need assistance:Nested CFLOOPs

2001-03-21 Thread Hayes, David

Try setting a variable to judgement.defendant before entering the second
loop, then use that variable in the innner loop.

-Original Message-
From: Angél Stewart [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 21, 2001 9:39 AM
To: CF-Talk
Subject: Need assistance:Nested CFLOOPs


Hi all.

I am having a problem with a nested CFLOOP refusing to loop!

The Code:
cfloop query="judgement" startrow="1" endrow="20"
CFSET CompanyList = "Limited,LTD,LTD.,CO,Co.,Company,,The"
cfloop index="counter" list="#CompanyList#" delimiters=","
CFOUTPUT The Defendant
IS:#judgement.defendant#/cfoutput
br
CFSET
WordToGet=ListGetAt(#CompanyList#,#counter#,",")
CFOUTPUT The Current List Item
Is:#WordToGet#/cfoutput
br
CFIF Find(judgement.defendant,#Counter#) neq 0

CFOUTPUT  Hey! We Found A Company
/cfoutput

/cfif
/CFLOOP
/CFLOOP

I want to search the defendant field to determine if any of those strings
are contained within it.
It cycled fine, until I enclosed it in the CFLOOP query="judgement"...

I expected it to go to the first record in teh Judgement table..

Then loop through the strings to search for, perform the search...and then
drop out and CFQUERY LOOP back to the top..wher eit would go to the next
record...and do the same thing.

What's the problem with my code?

This is my output:

The Defendant IS:MOHD, SARI
The Current List Item Is:Limited
The Defendant IS:MOHD, SARI
The Current List Item Is:Limited
The Defendant IS:MOHD, SARI
The Current List Item Is:Limited
The Defendant IS:MOHD, ANSARI
The Current List Item Is:Limited
The Defendant IS:MOHD, SARI
The Current List Item Is:Limited
The Defendant IS:MOHD, SARI
The Current List Item Is:Limited
The Defendant IS:MOHD, SARI
The Current List Item Is:Limited
The Defendant IS:MOHD, SARI

So it is clearly not cycling through the list of strings to search for.

-Gel
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Database Question

2001-03-21 Thread Hayes, David

There is no one-line SQL statement that will do that.

You would use some looping structure if you were passing in a list of IDs,
but if this is all occurring in the same batch, you can select your values
into a temp table, then use an INSERTSELECT statement to insert based on
your tempTable values.

SELECT ID
 INTO #myTemp
  FROM myTable1 
   WHERE SpecialID = 3

INSERT INTO table3 (ID)
SELECT ID from #myTemp


Check your SQL 7 help for more info on SELECT INTO and INSERT...SELECT.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 7:32 PM
To: CF-Talk
Subject: OT: Database Question


Fellow Listers!

All the talk about @@identity encouraged me to ask this question:

Say I:

UPDATE Table2
SET City = 'Oakland'
WHERE ID IN
(SELECT ID FROM MyTable1 WHERE SpecialID = 3)

This is done all within SQL7, and

SELECT ID FROM MyTable1 WHERE SpecialID = 3

is a comma-delimited list of IDs.

How would I do the case where I have Table3
with one column, and I wanted to INSERT the
IDs in it from:

SELECT ID FROM MyTable1 WHERE SpecialID=3

one ID per row, all within SQL7 (no CFAS)?

best,  paul

==
N: Paul Smith, Web/Database Droid
A: SupportNet, Inc, 3871 Piedmont Ave, Oakland, CA 94611
(There, there, there; there's, there, there)
P: (510) 763-2358  _o
C: (510) 205-6755  _\,_
F: (510) 763-2370 (_)/(_)
E: [EMAIL PROTECTED]
W: http://www.support.net
"The sun, with all those planets revolving around it and
dependent on it, can still ripen a bunch of grapes as if
it had nothing else to do."  --Galileo
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Need assistance:Nested CFLOOPs

2001-03-21 Thread Hayes, David

OK, here's something I missed the first time.

You use "counter" as your index in the cfloop, but this isn't an index loop;
since it's a list loop, counter evaluates to an item in the list.

Look at line 6 - you're using listGetAt with counter as the position
attribute; counter may be evaluating as "true" or 1 in this context
(although I'm surprised it's not throwing an error).  (You don't need the #
signs in the function call.)

You're using counter properly in line 9, although you don't need the # signs
here.

Naming the index "company" instead of "counter" might have helped; my guess
is you changed loop strategies at some point.


1cfloop query="judgement" startrow="1" endrow="20"
2   CFSET CompanyList = "Limited,LTD,LTD.,CO,Co.,Company,,The"
3   cfloop index="counter" list="#CompanyList#" delimiters=","
4   CFOUTPUT The Defendant
IS:#judgement.defendant#/cfoutput
5   br
6   CFSET
WordToGet=ListGetAt(#CompanyList#,#counter#,",")
7   CFOUTPUT The Current List Item
Is:#WordToGet#/cfoutput
8   br
9   CFIF Find(judgement.defendant,#Counter#) neq 0
10  CFOUTPUT  Hey! We Found A Company
/cfoutput
11  /cfif
12  /CFLOOP
13/CFLOOP

-Original Message-
From: Angél Stewart [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 21, 2001 1:42 PM
To: CF-Talk
Subject: RE: Need assistance:Nested CFLOOPs


umm..judgement.defendant is changing..thats not the problem.

The problem is that it is not going over the list of words to search for.
The list called Company List.

So hence you see Limited,Limited,Limited Limited 7 times in the output.

When what you should see is

The Defendant IS:MOHD, SARI
The Current List Item Is:Limited
The Defendant IS:MOHD, SARI
The Current List Item Is:Ltd
The Defendant IS:MOHD, SARI
The Current List Item Is:Ltd.
The Defendant IS:MOHD, SARI
The Current List Item Is:CO
The Defendant IS:MOHD, SARI
The Current List Item Is:CO.
The Defendant IS:MOHD, SARI
The Current List Item Is:THE

etc. etc.
But it is just picking up that first list item, Limited..and although it is
going over the thing 7 times..its not reading the other items in the list.

I know there is some simple syntax error somewhere..I just can't find it.

-Gel



-Original Message-
From: Phoeun Pha [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 21 March 2001 12:59
To: CF-Talk
Subject: RE: Need assistance:Nested CFLOOPs


I just skimmed through it, and it seemed that your query output is not
right.

When u do a judgement.defendant inside that query loop, it will always
remain the same.  it will always output the first row from that query.
instead, just use defendant.  since you're already inside that query loop,
it will refer to the query name.  there is no need to specify it




-Original Message-
From: Angél Stewart [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 21, 2001 9:39 AM
To: CF-Talk
Subject: Need assistance:Nested CFLOOPs


Hi all.

I am having a problem with a nested CFLOOP refusing to loop!

The Code:
cfloop query="judgement" startrow="1" endrow="20"
CFSET CompanyList = "Limited,LTD,LTD.,CO,Co.,Company,,The"
cfloop index="counter" list="#CompanyList#" delimiters=","
CFOUTPUT The Defendant
IS:#judgement.defendant#/cfoutput
br
CFSET
WordToGet=ListGetAt(#CompanyList#,#counter#,",")
CFOUTPUT The Current List Item
Is:#WordToGet#/cfoutput
br
CFIF Find(judgement.defendant,#Counter#) neq 0

CFOUTPUT  Hey! We Found A Company
/cfoutput

/cfif
/CFLOOP
/CFLOOP

I want to search the defendant field to determine if any of those strings
are contained within it.
It cycled fine, until I enclosed it in the CFLOOP query="judgement"...

I expected it to go to the first record in teh Judgement table..

Then loop through the strings to search for, perform the search...and then
drop out and CFQUERY LOOP back to the top..wher eit would go to the next
record...and do the same thing.

What's the problem with my code?

This is my output:

The Defendant IS:MOHD, SARI
The Current List Item Is:Limited
The Defendant IS:MOHD, SARI
The Current List Item Is:Limited
The Defendant IS:MOHD, SARI
The Current List Item Is:Limited
The Defendant IS:MOHD, ANSARI
The Current List Item Is:Limited
The Defendant IS:MOHD, SARI
The Current List Item Is:Limited
The Defendant IS:MOHD, SARI
The Current List Item Is:Limited
The Defendant IS:MOHD, SARI
The Current List Item Is:Limited
The Defendant IS:MOHD, SARI

So it is clearly not cycling through the list of strings to search for.

-Gel
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm


RE: Tracking two lists of numbers

2001-03-21 Thread Hayes, David

grin Well, this first idea may not be easier than what you've done so far;
you'll need to be able to use javascript to manipulate the options within a
select control, and you can't do that on Netscape 4.* (I'm not sure about
6.)

 

If you can develop this just IE only, I would suggest using two select
controls.  Populate the first with the currently unused steps, and populate
the second (a multi select control) with their existing steps; store the
step identifier as the value, and display the step name (or ID).

Using javascript, give them an add, remove, up and down button to manipulate
the contents of second control. Add moves the item from select1 to select2,
remove does the reverse. Up and down change the order of the options within
the control.

When the user submits the form, use javascript to "select" all the options
in select2; on your action page, you should have a comma-delimited list of
the stepIDs, in the order the group admin wants.  Then delete all the
records for that admin from your "steps order" table, and insert new records
based on the list.

 

Alternatively, you could use a text box (name="stepID") for each step,
using client-side validation for  distinct integers (or empty) before
submitting.  Then on your action page, you'll have numerous name=value pairs
like 32=1 and 45=2 (assuming 32 and 45 are stepIDs).  Delete the records for
this group admin, and insert new ones based on the values.  (You can deal
with gaps in the numbering either on the client side or on the action page.)


 

I wouldn't think you would need to record the number of steps they use in a
separate table; you can get that at any time using a SQL count function.

 

Good luck.

-Original Message-
From: Diana Nichols [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 21, 2001 1:41 PM
To: CF-Talk
Subject: Tracking two lists of numbers


This just can't be as hard as I'm making it!

I have a list of steps (1-20) each of which has 6 fields attached to it,
e.g.:
smstep1.smstep20
smstep1title.smstep20title
smstep1descsmstep20desc
smstep1prob.smstep20prob
smstep1note.smstep20note
smstep1date..smstep20date

Title, desc and prob are stored in table(1), as they apply to a group of
users, while the other 3 reside in table(2), which is particular to a
specfic user.

Now, for the issue: Each group admin can define the actual number of steps
they use, and the order in which they appear, and they can change either at
any time.

I have a field in table(1) called smstepslist which is where I store the
list of steps they choose to use, in their order. (e.g. 3,2,4,1,5,7), and
another where called smsteps where I store the total number of steps they
have in their list. (probably not a necessary duplication)

Here's the problem:
I can't figure out the form to allow them to order the steps. I have to keep
track of the original step number, and then place that number in
"smstepslist" in order, based upon their selection in the select box. (And
delete those where the checkbox is unchecked.) In other words, there are two
lists of step numbers that I have to keep up with...the original, and
theirs.

Below is the 21st iteration, and it still doesn't update correctly! I would
be most grateful for any help on the logic here.

cfif isDefined("update")
cfset newstepslist="#form.formsteps#"
cfloop from=1 to=#form.smsteps# index=thiscfset fieldname="step#this#"
cfif listfind("#form.fieldnames#",#this#) is 0cfset
newstepslist=listdeleteat("#newstepslist#",#this#)/cfif
/cfloop

cfquery datasource=#dsn#
update companies set smstepslist = '#newstepslist#' where
companyID=#companyID#
/cfquery

cflocation url="preferences.cfm" addtoken=no

cfelse
cfset find="smsteps, smstepslist"
cfloop from=1 to=20 index="stepno"
cfset find=listappend("#find#","SMstep#stepno#title, SMstep#stepno#prob")
/cfloop
cfquery name=get datasource=#dsn#
select #find# from companies where companyID = #companyID#
/cfquery
br
span class=headEdit Steps/span
table cellpadding=3
trtd colspan=3 class=mainChange the order of your steps by
changing the
boxes on the right.br
To eliminate a step, uncheck the box at the left.br
To add steps or edit titles, descriptions or probabilitites,
a
href="stepedit.cfm"CLICK HERE./a/td/tr

form name=update action="steporder.cfm?update=1" method=post
cfoutput
input type=hidden name=smsteps value=#get.smsteps#
cfset counter=0
cfloop list="#get.smstepslist#" index="companystep"cfset
counter=#counter#+1
cfset title="get.SMstep#companystep#title"cfset
prob=evaluate("get.SMstep#companystep#prob")*100
trtd align=right class=bold bgcolor=cc#evaluate(title)#
(#prob#%)/td
tdinput type=checkbox name="#companystep#" checked/td
tdselect name="formsteps"
cfloop from=1 to=#get.smsteps# index=thisno
option value="#thisno#" cfif #thisno# is

RE: Read part of a string

2001-03-20 Thread Hayes, David

Look at the list functions (your values can be thought of as lists,
delimited by "/") as well as the GetToken  function.

-Original Message-
From: Michael Gribbin [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 1:13 AM
To: CF-Talk
Subject: Read part of a string


Hi, I need to compare the first 4 characters of a product code "BA01/ABC" 
with the first 4 characters of the next product code in sequence "BA01/DEF"
to see if they belong to the same group. How do I "read" only those first 4
characters of each product code?

Thanks in advance,

Michael Gribbin
Digital Marketing Alliance
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: @@identity

2001-03-20 Thread Hayes, David

There is an issue with @@identity in MS-SQL.  From MS-SQL help:
@@IDENTITY returns the last identity value generated in "any table" in the
current session. (Quotations mine).

If you have any INSERT triggers on your table that perform INSERTS on other
tables, @@identity will return the identity of the last insert in your
triggers, rather than the one you want.

MS-SQL 2000 has a new function to deal with the issue called SCOPE_IDENTITY,
which "Returns the last IDENTITY value inserted into an IDENTITY column in
the same scope." 

-Original Message-
From: Daniel Lancelot [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 6:06 AM
To: CF-Talk
Subject: RE: @@identity


You need to use SET NOCOUNT ON / SET NOCOUNT OFF round your query to be able
to access the info in cfquery

e.g.
cfquery datasource="#request.dsn#"
name="qAddEntry"
SET NOCOUNT ON
INSERT INTO tblUsers(name, jobtitle,
company, address, town, postcode, countryID, email, website, password, hint,
maillist, brieflist, foundsiteID)
VALUES ('#form.name#', '#form.jobtitle#',
'#form.company#', '#form.address#',
'#form.town#','#form.postcode#',#form.countryID#, '#form.email#',
'#form.website#', '#form.password#', '#form.hint#', #maillist#, #brieflist#,
#form.foundsiteID#)
SELECT newID = @@IDENTITY
SET NOCOUNT OFF
/cfquery  --
cfoutput#qAddEntry.newID#/cfoutput

this works.

HTH

Dan
-Original Message-
From: Joshua Tipton [mailto:[EMAIL PROTECTED]]
Sent: 20 March 2001 05:07
To: CF-Talk
Subject: RE: @@identity


When I do that CF says not a valid query specified.

-Original Message-
From: CF [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 12:04 AM
To: CF-Talk
Subject: Re: @@identity


You need to give your query a name.  Instead cfquery name="", use cfquery
name="queryName".  Then you just access that variable as:

queryName.identity

Also, I don't know it it matters to your database or not, but you might want
to put a ; at the end of your first query to differentiate it from the next
.. just to avoid confusion.

Todd Ashworth
Web Application Developer
Network Administrator

Saber Corporation
314 Oakland Ave.
Rock Hill, SC 29730
(803) 327-0137 [111] (p)
(803) 328-2868 (f)

- Original Message -
From: "Joshua Tipton" [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Monday, March 19, 2001 11:32 PM
Subject: @@identity


 I know how to use @@identity to select the last inserted record right
under
 an insert but how do I display that id of that record?

 cfquery name="" datasource="gunledger" dbtype="ODBC"
 INSERT INTO dbo.distrib(compname, phonenum, address, address2, city,
state,
 zip, fflid, expires)
 VALUES('#compname#', '#phonenum#', '#address#', '#address2#', '#city#',
 '#state#', '#zip#', '#fflid#', '#expires#')
 select @@identity as 'identity'
 /cfquery

 How do I output the identity

 Josh



~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: DB structure advice

2001-03-20 Thread Hayes, David

I would break it into smaller tables.

One issue is size - you don't want to store a lot of empty fields.  Create
each table, and use a primary key ID field to link them.  

Just remember that when you want a record set with all the data, you will
need to use LEFT JOIN in order for the result set to include the members who
don't have records in the optional tables.

-Original Message-
From: Jason Lotz [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 10:52 AM
To: CF-Talk
Subject: DB structure advice


This is more of a theory question than an actualy request for help.  Let's
say you are building a database of members with lots of information that
applies to every member (name, address, phone, etc.)  This could be about 40
seperate fields.  Then, on top of that, each member can have lots of
optional information that can easily be grouped together.  For example, if
they graduated from college, you want to store their degree information or
if they own a company, you want to store their company info.  Each of these
"optional groups" are one-to-one (each member can only have one chunk of
this data but doesn't have to have it at all.) Now here's the question -

When you are building this database, you could easily put it into one huge
table because all the information is one-to-one.  However, it's a pain when
you only want to get the "degree" information or the "company" information.
From a programming standpoint, is it best to break these into smaller tables
for ease of use or to keep it into one table?

Thanks,
Jason
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Code review, PLEASE

2001-03-19 Thread Hayes, David

selectCandidate is your query name; a query can't be converted to a string.


You may want one of your query column names instead.

-Original Message-
From: Mike [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 2:01 PM
To: CF-Talk
Subject: Re: Code review, PLEASE


This is what I get now with the ##
Error Occurred While Processing Request
  Error Diagnostic Information
  Expression result cannot be converted to a string

  Expressions used inside tags like CFOUTPUT, CFQUERY, CFMAIL, etc. must
evaluate to a value that can be converted to a string for output or dynamic
text accumulation purposes. Complex objects, such as queries, arrays, and
COM/DCOM objects, cannot be represented as strings.

  The error occurred while processing an element with a general
identifier of (#selectcandidate#), occupying document position (22:39) to
(22:55).


  Date/Time: 03/19/01 15:00:27
  Browser: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
  Remote Address: 127.0.0.1




"Paul Ihrig" [EMAIL PROTECTED] wrote in message
1097F6DBC531D2118F180008C7B1682D03A1537D@NBBJCMHEX1">news:1097F6DBC531D2118F180008C7B1682D03A1537D@NBBJCMHEX1...

 input type="hidden" name="id" value="selectcandidate"
 doesn't the value need # symbols?

 -paul

 Web Developer, NBBJ
 Work: [EMAIL PROTECTED]
 614 241-3534
 fax: 614 485-5534

 Home: [EMAIL PROTECTED]
 614 449-1681

  icq: 47658358


 -Original Message-
 From: Mike [mailto:[EMAIL PROTECTED]]
 Sent: Monday, March 19, 2001 2:27 PM
 To: CF-Talk
 Subject: Code review, PLEASE


 I have to be missing something:  and I cant put my mouse on it


 !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
 !--- include toolbar.cfm---
 cfinclude template="Toolbar.cfm"
 html
 head
 CFPARAM Name="ID" Default=1
  titleInterview 2/title
 /head
 CFQUERY NAME="selectcandidate" DATASOURCE="interview"
 SELECT  ID, EmpCandidate, SKillBackground, Status, Recruiter, Profile,
 InitialIntdate, InitialInt, TechIntvdate, TechIntv, PeerInterviewdate,
 PeerInterview, MarkInterdate, MarkInter, ExtOfferdate, CheckRef,
StartDate,
 Comments
 FROM interview
 WHERE ID=#ID#
 /CFQUERY
 cfform action="interview2action.cfm" method="POST"


 CFSET NextID=#id#+1
 CFSET PrevID=#id#-1

 body bgcolor="6699ff"
 cfoutput query="selectcandidate"
 input type="hidden" name="id" value="selectcandidate"

 table width="95%" border="1" align="center" bgcolor="6699ff" 
   tr
 tdID/td
 tdCandidate Name/td
   /tr
   tr
 tdnbsp;#ID#/td
 tdnbsp;#EmpCandidate#/td
   /tr
   tr
 tdInitial Interview Date/td
 tdInitial Interview Notes/td
   /tr
   tr
 td valign="top"nbsp;cfinput type="Text" name="InitialIntdate"
 value="#InitialIntdate#"/td
 tdnbsp;textarea cols="65" rows="5"
 name="InitialInt"#InitialInt#/textarea/td
   /tr
   tr
 tdTechnical Interview Date/td
 tdTechnical Interview Notes/td
   /tr
   tr
   td valign="top"nbsp;cfinput type="Text" name="TechIntvDate"
 value="#Techintvdate#"/td
 tdnbsp;textarea cols="65" rows="5"
 name="TechIntv"#TechIntv#/textarea/td
   /tr
   tr
 tdPeer Interview Date/td
 tdPeer Interview Notes/td
   /tr
   tr
 td valign="top"nbsp;cfinput type="Text" name="PeerInterviewdate"
 value="#PeerInterviewdate#" required="No"/td
 tdnbsp;textarea cols="65" rows="5"
 name="PeerInterview"#PeerInterview#/textarea/td
   /tr
   tr
 tdMarketing Interview Date/td
 tdMarketing Interview Notes/td
   /tr
   tr
 td valign="top"nbsp;cfinput type="Text" name="MarkInterdate"
 value="#MarkInterdate#" required="No"/td
 tdnbsp;textarea cols="65" rows="5"
 name="MarkInter"#MarkInter#/textarea/td
   /tr
   tr
 td valign="top"Offer Extended Date/td
 tdReference Check/td
   /tr
   tr
 td valign="top"nbsp;cfinput type="Text" name="ExtOfferdate"
 value="#ExtOfferdate#"/td
 tdnbsp;textarea cols="65" rows="5"
 name="CheckRef"#CheckRef#/textarea/td
   /tr
   tr
 tdStart Date/td
 tdAdditional Comments/td
   /tr
   tr
 td valign="top"nbsp;cfinput type="Text" name="StartDate"
 value="#StartDate#" required="No"/td
 tdtextarea cols="65" rows="5"
 name="Comments"#Comments#/textarea/td
   /tr
 /table

 table width="85%" border="0"
 TR
 TD align="left"a href="interview2.cfm?ID=#PrevID#"Previous/a/TD
 td align="right"a href="interview2.cfm?ID=#NextID#"Next/a/td
 /td/TR/table
 /cfoutput
 input type="submit" name="Action" value="Update Criteria"
 /cfform
 /body
 /html


 TIA

 Michael

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Parsing a text field from a db...

2001-03-19 Thread Hayes, David

Check the evaluate function.  #evaluate(myQueryName.article)#

You'll need to replace the single # with double ## before evaluating it.

-Original Message-
From: Christian N. Abad [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 1:57 PM
To: CF-Talk
Subject: Parsing a text field from a db...


Folks:

Here is today's challenge :

I have a database that stores Library articles (how-to's).

I need to be able to store ColdFusion markup in the database and have it
parsed once the row is retrieved from the database.

For example, I store the following text in the db:

img src="#application.imagesRoot#/library/image.gif"

Then, I retrieve this Library item from the db with a query and display it,
like this :

cfoutput#myQueryName.article#/cfoutput

PROBLEM : The text that is written to the html file the LITERAL text from
the database.  Instead, I need to have this text parsed and interpreted as
CFML.

Does this make sense?

Any ideas?!

Thanks!

Christian N. Abad
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: cf query?

2001-03-19 Thread Hayes, David

1) If PromoID is numeric, omit the single quotes.

2) Your select statement returns the value, so you can just add 1 to it; you
don't need to attempt to refer to it again with #Info.ClickThroughs#

UPDATE NetReferrers
SET ClickThroughs = (SELECT Info.ClickThroughs
FROM Info.NetReferrers
WHERE PromoID = #URL.Promo#) + 1
WHERE PromoID = #URL.Promo#




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 1:32 PM
To: CF-Talk
Subject: cf query?


cfquery datasource="blah" username="user" password="pass"
name="addclickthrough"
UPDATE NetReferrers
SET ClickThroughs = (SELECT Info.ClickThroughs
FROM Info.NetReferrers
WHERE PromoID = '#URL.Promo#')
#Info.ClickThroughs# + 1
WHERE PromoID = '#URL.Promo#'
/cfquery


Am i doing this right, or am i just not thinking correctly today???

Thanks,

Kevin


~
Kevin Mansel
Web Developer
Fox Communications
[EMAIL PROTECTED]


 Kevin Mansel.vcf
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: cf query?

2001-03-19 Thread Hayes, David

cf_sheepishGrin 
And as Dave Watts noted, you don't even need the subquery.
/cf_sheepishGrin

-Original Message-
From: Hayes, David [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 2:31 PM
To: CF-Talk
Subject: RE: cf query?


1) If PromoID is numeric, omit the single quotes.

2) Your select statement returns the value, so you can just add 1 to it; you
don't need to attempt to refer to it again with #Info.ClickThroughs#

UPDATE NetReferrers
SET ClickThroughs = (SELECT Info.ClickThroughs
FROM Info.NetReferrers
WHERE PromoID = #URL.Promo#) + 1
WHERE PromoID = #URL.Promo#




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 1:32 PM
To: CF-Talk
Subject: cf query?


cfquery datasource="blah" username="user" password="pass"
name="addclickthrough"
UPDATE NetReferrers
SET ClickThroughs = (SELECT Info.ClickThroughs
FROM Info.NetReferrers
WHERE PromoID = '#URL.Promo#')
#Info.ClickThroughs# + 1
WHERE PromoID = '#URL.Promo#'
/cfquery


Am i doing this right, or am i just not thinking correctly today???

Thanks,

Kevin


~
Kevin Mansel
Web Developer
Fox Communications
[EMAIL PROTECTED]


 Kevin Mansel.vcf
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Nested Query

2001-03-15 Thread Hayes, David

E_ID='#RESOURCE_ID#'

If this is an integer field, it shouldn't have the single quotes around the
value.

Prepare to hear feedback on using "select *".



-Original Message-
From: Michael S. Kimmett [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 15, 2001 2:34 PM
To: CF-Talk
Subject: Nested Query


I am having the worst time trying to figure out why the last query( See
Below ) in this chain of if statements is not working.  The error that I am
getting from the CFServer when I try to execute the last query is:

Message: ODBC Error Code = 37000 (Syntax error or access violation) 
Detail: [Microsoft][ODBC SQL Server Driver][SQL Server]Error converting data
type varchar to numeric. 

The query is being populated from a form and all the other queries are
working except for the last one (However all the queries are working in the
MS Query Analyzer when hard coded with data).  I have done a CFOUTPUT to
check what type of data is being input into the query, but the data is
correct!  Anyone have an idea as to why this last query is not working?

Thanks in advance.

Michael

!--- THE QUERY ---
CFIF isDefined("RESOURCE_ID") AND RESOURCE_ID IS NOT ""
  CFIF isDefined("PROJECT_ID") AND PROJECT_ID IS NOT ""
   CFIF isDefined("OPEN_DATE") AND OPEN_DATE IS NOT ""
   CFIF isDefined("CLOSE_DATE") AND CLOSE_DATE IS NOT ""
CFQUERY name="SearchByName"
 datasource="#request.site.ODBC_DataSource#"
 dbtype="ODBC"
 username="#request.site.ODBC_UserName#"
 password="#request.site.ODBC_UserPassword#"
   cachedwithin="#CreateTimeSpan(0,0,15,0)#"

SELECT * FROM CMD_CTR, ACT_ITEM, EMPLOYEE 
WHERE CMD_CTR.ACTION_ID=ACT_ITEM.ACTION_ID
AND CMD_CTR.E_ID=EMPLOYEE.E_ID 
AND CMD_CTR.E_ID='#RESOURCE_ID#'
AND CMD_CTR.P_ID='#PROJECT_ID#'
AND ACT_ITEM.OPEN_DATE='#OPEN_DATE#'
AND ACT_ITEM.CLOSE_DATE='#CLOSE_DATE#' 
  
/CFQUERY
   CFELSE
CFQUERY name="SearchByName"
 datasource="#request.site.ODBC_DataSource#"
 dbtype="ODBC"
 username="#request.site.ODBC_UserName#"
 password="#request.site.ODBC_UserPassword#"
   cachedwithin="#CreateTimeSpan(0,0,15,0)#"

SELECT * FROM CMD_CTR, ACT_ITEM, EMPLOYEE 
WHERE CMD_CTR.ACTION_ID=ACT_ITEM.ACTION_ID
AND CMD_CTR.E_ID=EMPLOYEE.E_ID 
AND CMD_CTR.E_ID='#RESOURCE_ID#'
AND CMD_CTR.P_ID='#PROJECT_ID#'
AND ACT_ITEM.OPEN_DATE='#OPEN_DATE#'
 
  /CFQUERY
   /CFIF !--- END OF CFIF FOR CLOSE DATE ---
 CFELSE
   CFQUERY name="SearchByName"
 datasource="#request.site.ODBC_DataSource#"
 dbtype="ODBC"
 username="#request.site.ODBC_UserName#"
 password="#request.site.ODBC_UserPassword#"
   cachedwithin="#CreateTimeSpan(0,0,15,0)#"

SELECT * FROM CMD_CTR, ACT_ITEM, EMPLOYEE 
WHERE CMD_CTR.ACTION_ID=ACT_ITEM.ACTION_ID
AND CMD_CTR.E_ID=EMPLOYEE.E_ID 
AND CMD_CTR.E_ID='#RESOURCE_ID#'
AND CMD_CTR.P_ID='#PROJECT_ID#'
 
   /CFQUERY   
   /CFIF !--- END OF CFIF FOR OPEN DATE ---
  CFELSE
!---THIS IS THE QUERY THAT IS NOT WORKING! ---
CFQUERY name="SearchByName"
 datasource="#request.site.ODBC_DataSource#"
 dbtype="ODBC"
 username="#request.site.ODBC_UserName#"
 password="#request.site.ODBC_UserPassword#"
   cachedwithin="#CreateTimeSpan(0,0,15,0)#"

SELECT * FROM CMD_CTR 
WHERE 
 E_ID='#RESOURCE_ID#'
 
 /CFQUERY 
  /CFIF!--- END OF CFIF FOR PROJECT_ID ---
 CFELSE
   CFSET errmess = "You did not enter any information to search by."
   CFLOCATION URL="index.cfm?fuseaction=errormessage=#errmess#"
/CFIF!--- END OF CFIF FOR RESOURCE_ID ---
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: faulty join?

2001-03-13 Thread Hayes, David

Hi, Megan

You will get the prereq list for each distinct schedule date for the class;
I'm assuming your query is returning 3 dates for the class.

Dave

-Original Message-
From: megan sherman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 9:02 AM
To: CF-Talk
Subject: faulty join?


Hi,
I'm trying to display (kayak) class information on a web page. I have 3
tables, one for class description (primary key "classID"), one for class
prerequisites (primary key "prereqID"), and one for class schedule
(primary key "scheduleID"). I have slimmed down the query and the output
below. It only sorta works. I get a single output of the description,
and a single output of the location/date (no repeats), but something
goes wrong with the prereq's. If there is class with three
prerequisites, say #1 #2 and #5, then the output loop for that class
yields #5 #1 #2, #1 #2 #5,  and #1 #5 #2. I only want the list of
prerequisites to show up once. I've tried a bunch of stuff, but I'm
obviously just guessing. Does anybody have a suggestion toward what I'm
doing wrong?
Thanks in advance,
Megan

SELECT class.classID, class.content, class_schedule.scheduleID,
class_schedule.location, class_schedule.date, class_prereq.prereqID,
class_prereq.prereq
 FROM class, class_schedule, class_prereq
 WHERE (pagename = 'classes_sea' and
class.classID=class_schedule.classID and
class_prereq.classID=class.classID)
 ORDER by rank, class_schedule.location, class_schedule.date

CFOUTPUT QUERY="content" group="classID"
p
class:br /
#content#br /
cfoutput group="prereqID"#prereq# br //cfoutput
cfoutput group="scheduleID"#location#, #date# br //cfoutput
/p
/CFOUTPUT


Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Javascript IsDefined

2001-03-13 Thread Hayes, David

You can use the "typeof" operator.

if (typeof myVarName == "undefined"){

}

-Original Message-
From: Jeanne Sarfaty Glazer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 9:27 AM
To: CF-Talk
Subject: Javascript IsDefined


Hi Folks,

What is the Javascript equivalent to the Cold Fusion IsDefined function?  
(or does one even exist?!)

TIA,
- - - Jeanne
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Broken Images / Testing for file existence

2001-03-13 Thread Hayes, David

I don't know that you can.

I would store that info in the database; it could be a flag which simply
indicates the existence of the file or not.

You could write a CF page to update the db as often as necessary (once,
hourly, daily, etc.); that page would check to see if the file exists, then
update the db.  (Don't update the db for each record; loop through your
productnums, delete productnums that don't have graphic file, then do one db
update along the lines of "update table set hasGraphic = 1 where
productnum in (listOfProductNums)"



-Original Message-
From: Tony Schreiber [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 2:06 AM
To: CF-Talk
Subject: Broken Images / Testing for file existence


I have an application where I list several items on a page and display an
image for that item based on a reference number (ie, productnum+.jpg). The
database table does not tell me whether there is an image for that item
and there are many that do have one.

I'd like to display an alternate image (or nothing at all) when there is
no image present, but I can't see using an CFIF FileExists for every
item for 50 or so on a page. Plus, I can't even do that because I'm
grabbing the images from a different server via http only (IMG
SRC="http://otherserver/path/number.jpg)...

How can I avoid displaying broken images?


Tony Schreiber, Senior Partner  Man and Machine, Limited
mailto:[EMAIL PROTECTED]   http://www.technocraft.com

http://www.linktoss.com ___The Fastest Way to Send a Link to Anyone!
http://www.digitacamera.com __DigitA Camera Scripts and Tips
http://www.is300.net ___The Enthusiast's Home of the Lexus IS300
http://www.cfug-sfl.org ___South Florida Cold Fusion Users Group
http://www.simplemessageboard.com ___Free Forum Software for Cold Fusion
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: cfhttpparam results in a popup window

2001-03-10 Thread Hayes, David

The html 4.0 FORM element allows a "target" attribute; if you set it to
"_blank", the action page will open in a new window.

At the top of the new page, include

SCRIPT language="javascript"
opener.location.href = "successpage name";
/SCRIPT

-Original Message-
From: Mark Smeets [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 09, 2001 9:06 PM
To: CF-Talk
Subject: RE: cfhttpparam results in a popup window


Sorry for not clarifying, they activate it via form.

Maybe you can elaborate on the solution, my javascript knowledge is somewhat

lacking.

Thanks

Date: Fri, 09 Mar 2001 09:17:30 -0600
From: "Hayes, David" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: cfhttpparam results in a popup window
Message-ID: 
[EMAIL PROTECTED]

How is the user activating the search of the other site?  If it's a link (or
a form post), you can set the target to a new window.

In the page that loads in the new window, you could include some javascript
like

opener.location.href = "successpage.cfm".

-Original Message-
From: Mark Smeets [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 9:11 PM
To: CF-Talk
Subject: cfhttpparam results in a popup window


Here's what I want to do but I'm having no luck doing this.

I have a page which searches another website and returns its results in my
own website (gotta love that cfhttp) now unfortunately the design for this
site (the site I am searching) doesn't fit in my website at all, so I want
to return the results in a popup window.

This hasn't proven to be easy, in fact after messing with it, I'm pretty
much lost.

Basically 2 things have to happen. The results are returned in a popup
window and then you're taken to a "success" page, or something like a
success page (haven't decided on it's content but it's a page none the less)

Any solution is appreciated.
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: dynamic query construction

2001-03-09 Thread Hayes, David

I haven't looked at your code in detail, but as a first step, I would turn
on debugging, see exactly what query is being generated by your code and
what form values are being returned, and then try running that query
directly in your db tool.

Actually one issue on my quick scan is:
cfoutput query="qGetDept"
option value="2"#qGetDept.DepartmentName#/option
/cfoutput

This form field will only return 1 or 2, which seems like it probably won't
match on department name in this code:
CFIF FORM.DepartmentName IS NOT " "
AND DepartmentName = '#FORM.DepartmentName#'
/CFIF

-Original Message-
From: Gary Hayden-Sofio [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 09, 2001 8:50 AM
To: CF-Talk
Subject: dynamic query construction


I am building an application that will allow an end-viewer to search a staff
directory based  upon either partial or full last name (a text field), or
department (a dynamically populated  select menu).

I am trying to initiate and post the results of this dynamic query using
end-viewer input  from a form that exists on the same page as the query.

Though new to ColdFusion, I believe I am close to having the query
constructed properly. In fact, I don't get an error message when running the
page  (http://134.29.247.12/facultyStaffDirectory/index.cfm) AND performing
a SEARCH.
Unfortunately, I get no results from the SEARCH either.

I am not sure how to re-initiate a query with data from a form that exists
on the same page  as the query. And I am stumped... all help is very much
appreciated.

Gary H-S




!--- query that dynamically fills select menu with department names ---

CFQUERY NAME="qGetDept" DATASOURCE="facultyStaffDirectory"
SELECT  DepartmentName
FROM tblRefDepartments
ORDER BY  DepartmentName
/CFQUERY

!---form that allows for search based on partial or full input of lastname,
and builds dynamic select menu from results of qGetDept query ---

form method="post" action="index.cfm" name="search"
table width="640" border="0" cellspacing="0" cellpadding="2"

!--- text field that allows for partial or full input of lastname ---

tr
td width="64"img src="transparent.gif" width="1" height="1"img
src="transparent.gif" width="64" height="1" alt=" "/td
td width="576" 
div align="right"font face="Arial, Helvetica, sans-serif" size="2"Search
by blast name/b:/font 

input type="text" name="Lastname" size="25" maxlength="130"
input type="submit" name="submit1" value="search"
/div
/td
/tr

!--- text field that builds dynamic select menu from results of qGetDept
query ---

tr
td width="64"img src="transparent.gif" width="1" height="1"img
src="transparent.gif" width="64" height="1" alt=" "/td
td width="576"
div align="right"font face="Arial, Helvetica, sans-serif" size="2"Search
by bdepartment/program/b:/font 
select name="DepartmentName"
option value="1" SELECTEDchoose.../option
cfoutput query="qGetDept"
option value="2"#qGetDept.DepartmentName#/option
/cfoutput
/select
input type="submit" name="submit2" value="search"
/div
/td
/tr
/table
/form
br

table width="640" border="0" cellspacing="0" cellpadding="1"
tr 
td width="64"img src="transparent.gif" width="64" height="1" alt=" "
/td

td width="576"
table cellpadding="0" cellspacing="0" border="0" width="576"
tr bgcolor="#432684"
td width="205" height="24"bfont face="Arial" size="2"
color="#FF"Name/font/b/td
td width="240" height="24"bfont face="Arial" size="2"
color="#FF"Title/font/b/td
td width="70" height="24"bfont face="Arial" size="2"
color="#FF"Phone/font/b/td
td width="61" height="24"bfont face="Arial" size="2"
color="#FF"Office/font/b/td
/tr
/table
/td
/tr
/table

!--- the query that makes this whole page go... in theory, anyway ---

CFQUERY NAME="qGetListing" DATASOURCE="facultyStaffDirectory"
SELECT  Lastname, Firstname, Title, Phone, Location, DepartmentName
FROMtblNames
WHERE   0 = 0

CFIF IsDefined("FORM.Lastname")
CFIF FORM.Lastname IS NOT " "
AND Lastname LIKE '#FORM.Lastname#%'
/CFIF
/CFIF

CFIF IsDefined("FORM.DepartmentName")
CFIF FORM.DepartmentName IS NOT " "
AND DepartmentName = '#FORM.DepartmentName#'
/CFIF
/CFIF

ORDER BY  Lastname, Firstname
/CFQUERY

table width="640" border="0" cellspacing="0" cellpadding="1"
tr 
td width="64"img src="transparent.gif" width="64" height="1" alt=" "
/td

td width="576"
table cellpadding="0" cellspacing="0" border="0" width="576"
cfoutput query="qGetListing"
tr
cfif qGetListing.currentrow mod 2 eq 0
bgcolor="DFDFDF"
cfelse
bgcolor="FF"
/cfif

td width="205" height="20"font face="Arial"
size="1"#qGetListing.Lastname#, #qGetListing.Firstname#/font/td
td width="240" height="20"font face="Arial"
size="1"#qGetListing.Title#/font/td
td width="70" height="20"font face="Arial"
size="1"#qGetListing..Phone#/font/td
td width="61" height="20"font face="Arial"
size="1"#qGetListing..Location#/font/td
/tr
/cfoutput
/table
/td
/tr
/table

br

table width="640" border="0" cellspacing="0" cellpadding="0"
tr 
td width="64"img src="transparent.gif" 

RE: cfhttpparam results in a popup window

2001-03-09 Thread Hayes, David

How is the user activating the search of the other site?  If it's a link (or
a form post), you can set the target to a new window.

In the page that loads in the new window, you could include some javascript
like

opener.location.href = "successpage.cfm".

-Original Message-
From: Mark Smeets [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 9:11 PM
To: CF-Talk
Subject: cfhttpparam results in a popup window


Here's what I want to do but I'm having no luck doing this.

I have a page which searches another website and returns its results in my 
own website (gotta love that cfhttp) now unfortunately the design for this 
site (the site I am searching) doesn't fit in my website at all, so I want 
to return the results in a popup window.

This hasn't proven to be easy, in fact after messing with it, I'm pretty 
much lost.

Basically 2 things have to happen. The results are returned in a popup 
window and then you're taken to a "success" page, or something like a 
success page (haven't decided on it's content but it's a page none the less)

Any solution is appreciated.
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: How to fast big query result on browser

2001-03-09 Thread Hayes, David

How many options are you putting in your select box?  

-Original Message-
From: George Dong [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 09, 2001 12:30 PM
To: CF-Talk
Subject: How to fast big query result on browser


Hi there,
I have one problem, I made a select box, the option items come from a query
result, due to 20, 000 records, so the browser is very slow for that
template, even I already cached query on server.

If any one has a good sulotion?

thx.
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: stored procedure and resultset

2001-03-09 Thread Hayes, David

I'm sorry, Mei; I scanned your post too quickly.  I don't have enough
experience in Oracle to answer your question.

-Original Message-
From: Zhou, Mei Y (Mei) [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 09, 2001 12:44 PM
To: CF-Talk
Subject: RE: stored procedure and resultset


David:

Did you use that in Oracle before? The reason I asked is that in ColdFusion
knowledge
base, for article # 8353, it said that 


---
Oracle stored procedures do not return result sets in the traditional sense.
Consequently, it is not possible to generate a query in ColdFusion using an
Oracle stored procedure.

---

I should do some test, however, I am busying with design spec, just check
with you.

Thanks.

Mei
-Original Message-
From: Hayes, David [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 5:42 PM
To: CF-Talk
Subject: RE: stored procedure and resultset


Yes.  Look at CFSTOREDPROC and CFPROCRESULT; basically, you include one
CFPROCRESULT tag for each result set in the stored procedure.  Then you've
got named CFQUERY objects you can work with.

-Original Message-
From: Zhou, Mei Y (Mei) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 3:43 PM
To: CF-Talk
Subject: stored procedure and resultset


Can we loop all the recordsets in the stored procedures with CF 4.5 and
Oracle 8.1?
I have done this with ASP and SQL Server 7.0:

E.g. 

create procedure sp_Money

select * from tbl1 where fname = "mei";
select * from tbl2 where targetSalary = "1,000,000";

then, after execute the stored procedure, we can loop it as:

objRec = NextRecordset; ( not exactly syntax, but the idea is there...)
do while not objRec.eof
--- objRec will be all the records return from the first select...;

objRec = NextRecordset;
--- this time, objRec will be all the records from the second select...

CAN we do that? Any information is greatly appreciated.

Mei
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Sorting an Array

2001-03-09 Thread Hayes, David

Show your code.

-Original Message-
From: Matt Rodosky [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 09, 2001 1:31 PM
To: CF-Talk
Subject: Sorting an Array


Been trying to sort a 2 dimensional array and am having trouble. The fisrt
element is numeric, the 2nd is text. I'm trying to sort in numeric order on
the 1st item and can't get it to work.

Any help is appreciated.

TIA
Matt
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Re[2]: Javascript: Tearing my hair out

2001-03-08 Thread Hayes, David

I believe the first invocation of document.write clears the current
document, so that those objects are no longer in existence.

What you could try is concatenating all the strings you want to write in a
varible (e.g., myString), then calling document.write once.


function resetwhereboxes(fname){
 myString = fname + ' ' + document.forms.wheres.wherefield1.name;
 document.write(myString);
}

I'm not sure what you're trying to accomplish, however.




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 11:31 AM
To: CF-Talk
Subject: Re[2]: Javascript: Tearing my hair out


Another suggestion (or is it the same???)  is to create the object with an
"input type=hidden" statement and a default value.  Then when your page is
read,
the object exists for the OnSubmit function.


Carol L. Bluestein
Senior Programmer
NYS Office of Real Property
518-486-6335
[EMAIL PROTECTED]


Reply Separator
Subject:Re: Javascript: Tearing my hair out
Author: [EMAIL PROTECTED]
Date:   3/8/01 9:12 AM

Put the script after you create the element.  I had the same problem with a
clock on our web page.

Richard Ramos
Network Administrator
Softitler Net, Inc.
www.softitler.com
[EMAIL PROTECTED]

- Original Message -
From: "Windle, Kevan" [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Thursday, March 08, 2001 9:03 AM
Subject: Javascript: Tearing my hair out


 I'm using IE5. Trying to do something really simple in javascript. The
 problem I'm having is this. I can reference a form element with inline
code.
 So passing this variable to a function like this works:

 input

ondblclick="resetwhereboxes(this.value,3,document.forms.wheres.wherefield1.n
 ame)" type="text" size="10"  name="wherefield1"

 then in the function:

 SCRIPT type="text/javascript" language="JavaScript1.2"!--
 function resetwhereboxes(fname){
 1 document.write(fname);
 2 document.write(document.forms.wheres.wherefield1.name);
 3 document.write(document.forms[0].wherefield1.name);


 }--
 /script
 line 1 works. But line 2 and 3, give the error messages claiming there is
no
 such object.

 Anyone seen anything like this?




**

 The opinions expressed in this E-mail are those  of  the individual  and
 not  necessarily  the  company.  This E-mail and  any files transmitted
 with it are confidential and solely for the use of the intended recipients



**


~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: query troubles

2001-03-08 Thread Hayes, David

I believe you can only insert into 1 table per insert statement; you'll have
to break it into multiple statements.

-Original Message-
From: C Frederic Valone [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 12:47 PM
To: CF-Talk
Subject: query troubles


hello,
Can anyone show me what is wrong with this query? I know that I really
should use another method to put this information into the
database (triggers or sps come to mind) but I am using dbf files exported
out of access on a unix box to prototype the app and
they do not support these functions. 
 Here is the error

ODBC Error Code = 37000 (Syntax error or access violation)

 [MERANT][ODBC dBase driver]Missing VALUES keyword in INSERT statement

 SQL = "insert into HERDING, WORKING, TOY, TERRIER, SPORTING, NON_SPOR,
HOUND (HERDING.SHOW_ID, WORKING.SHOW_ID,
 TOY.SHOW_ID, TERRIER.SHOW_ID, SPORTING.SHOW_ID, NON_SPOR.SHOW_ID,
HOUND.SHOW_ID) values (14, 14, 14, 14, 14, 14, 14)"

and here is the query

cfquery name="insert_show_id" datasource="#dsds#" dbtype="ODBC"
insert 
into HERDING, WORKING, TOY, TERRIER, SPORTING, NON_SPOR, HOUND
(HERDING.SHOW_ID, WORKING.SHOW_ID, TOY.SHOW_ID, TERRIER.SHOW_ID,
SPORTING.SHOW_ID, NON_SPOR.SHOW_ID, HOUND.SHOW_ID)
values(#trim(show_id)#, #trim(show_id)#, #trim(show_id)#, #trim(show_id)#,
#trim(show_id)#, #trim(show_id)#, #trim(show_id)#)
/cfquery
I also tried it with

cfquery name="insert_show_id" datasource="#dsds#" dbtype="ODBC"
insert 
into HERDING, WORKING, TOY, TERRIER, SPORTING, NON_SPOR, HOUND
(SHOW_ID)
values(#trim(show_id)#)
/cfquery


  / \__
Frederic Valone  (@\___ 
Webmaster   /  O  
American Kennel Club   /(_/ 
  /_/ U
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Determining no. of pages in results

2001-03-08 Thread Hayes, David

You can check query_name.CurrentRow as you are outputting the query. The
page number is CurrentRow/10.

-Original Message-
From: W Luke [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 12:43 PM
To: CF-Talk
Subject: Determining no. of pages in results


Hi,

I have a query which searches a table, and displays results, 10 at a time.
How can I display the page-numbers though, so users can scroll through to a
page further along the query (1,2,3,4 etc)?

To get the number of pages, all I've done is:

cfset noPages = round(getads.recordcount / 10

Any ideas?

Thanks.

Will
--
[EMAIL PROTECTED] -=- www.lukrative.com
Local-Advertising -=- www.localbounty.com
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: stored procedure and resultset

2001-03-08 Thread Hayes, David

Yes.  Look at CFSTOREDPROC and CFPROCRESULT; basically, you include one
CFPROCRESULT tag for each result set in the stored procedure.  Then you've
got named CFQUERY objects you can work with.

-Original Message-
From: Zhou, Mei Y (Mei) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 3:43 PM
To: CF-Talk
Subject: stored procedure and resultset


Can we loop all the recordsets in the stored procedures with CF 4.5 and
Oracle 8.1?
I have done this with ASP and SQL Server 7.0:

E.g. 

create procedure sp_Money

select * from tbl1 where fname = "mei";
select * from tbl2 where targetSalary = "1,000,000";

then, after execute the stored procedure, we can loop it as:

objRec = NextRecordset; ( not exactly syntax, but the idea is there...)
do while not objRec.eof
--- objRec will be all the records return from the first select...;

objRec = NextRecordset;
--- this time, objRec will be all the records from the second select...

CAN we do that? Any information is greatly appreciated.

Mei
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Anyone know of a custom tag to query a query ?

2001-03-08 Thread Hayes, David

I don't know of a custom tag, but if you use Query functions, you can fake
it.

Use QueryNew(myCFQUERY.columnlist) to create a new query object.

Then iterate through your CFQUERY and check for whichever values you want.
You can get clever by using valueList on your CFQUERY object to create
lookup lists; you could then get a listposition from the lookup list, and
use that as the startRow attribute for a CFOUTPUT of your created query
object.

grin At least, it sounds like it should work.  It's hard to suggest the
best solution without knowing the amount of data involved.

Dave

-Original Message-
From: Kevin Gilchrist [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 4:33 PM
To: CF-Talk
Subject: Anyone know of a custom tag to query a query ?


Hi,

I know this will be included in CF 5.0 but unfortunately that won't be
around soon enough.
Before I haul off and try to write something to do this, does anybody know
of a custom tag that will query a query?
I've browsed through Allaire's tag gallery and while there are a number of
tags that will manipulate queries there's nothing that gets a subset of data
from an existing query.

I'd written a lot code that performed lots of small single queries which
made the data more accessible to me in terms of variable granularity, i.e.
one query name per small query but due to bad performance our DBA
recommended that I reduce the number of queries by being less specific and
parse the data on the CF side.

Thanks,
Kevin
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: business dates

2001-01-22 Thread Hayes, David

Here's some SQL-2000 code to get you started; it works, but will need some
tweaking to meet your specific requirements.

declare @mystart smalldatetime
declare @myend smalldatetime
declare @businessHoursPerDay tinyint
declare @myHolidayCount tinyint

select @mystart = '01-12-01', @myend = '01-22-01', @businessHoursPerDay = 8

select @myHolidayCount = count(*) from table of holidays where holiday
date field BETWEEN @myStart AND @myEnd

select ((dateDiff(d,@mystart,@myend) - (dateDiff(wk,@mystart,@myend)*2)) -
@myHolidayCount) * @businessHoursPerDay



-Original Message-
From: Alex [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 22, 2001 9:20 AM
To: CF-Talk
Subject: business dates


i need to get the number of business dates/hours between 2 user defined
dates.
i am using SQLServer. 
does anyone know how to do this?
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Outer Join Question...

2001-01-22 Thread Hayes, David

How about

Select groupID, groupName
from grouptable
where groupID NOT IN 
(select groupID from groupUserTable where userID = #userID#)

?


-Original Message-
From: Jeffry Houser [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 22, 2001 1:30 PM
To: CF-Talk
Subject: Outer Join Question...



  I'm stuck:


 The tables:

  grouptable (groupID, groupname)
 usertable (userID, otheruserinformation)
 groupusertable  (groupID, userID)

 Given the userID, how do I get a list of groups that the user is not in?


  This will return all the groups that the user is in:

SELECT DISTINCT grouptable.groupID, grouptable.groupname
FROM grouptable LEFT OUTER JOIN groupusertable
ON (grouptable.groupID = groupusertable.groupID) and
   (groupusertable.userID = #userID#)



  This will return all groups the user is not in, but some other user
is:

SELECT DISTINCT grouptable.groupID, grouptable.groupname
FROM grouptable LEFT OUTER JOIN groupusertable
ON (grouptable.groupID = groupusertable.groupID) and
   not (groupusertable.userID = #userID#)


  Any help, would be appreciated.  Thanks

--
Jeff Houser | mailto:[EMAIL PROTECTED]
AIM: Reboog711  | ICQ: 5246969 | Phone: 860-229-2781
--
Instant ColdFusion 4.5  | ISBN: 0-07-213238-8
Due out 3rd Quarter 2001
--
DotComIt, LLC
database driven web data using ColdFusion, Lotus Notes/Domino
--
Half of the Alternative Folk Duo called Far Cry Fly
http://www.farcryfly.com | http://www.mp3.com/FarCryFly
--
Promise me no dead end streets, and I'll guarantee we'll have a road
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: data in columns

2001-01-19 Thread Hayes, David

1) Pull the cfset out of the cfquery block

2) You are searching on LIKE 'CBI', but testing on EQ 'CBI'; are you sure
about the values?  

3) Select count(cbi) as cbicount
from wweb
where cbi = 'CBI'


-Original Message-
From: Robert Orlini [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 18, 2001 9:48 AM
To: CF-Talk
Subject: data in columns


Hello,

I'm still a newbie with this one though I've tried. How can I count data in
certain columns of a table for each record. Some records have no data in
this field of the column so of course I don't want that counted. I kept it
VERY VERY simple below. I've tried different configurations, but #cbicount#
always returns a blank.

Any help is always appreciated. Thank you.

Robert O.
--

Below I'm trying to count how many times CBI appears in the cbi column and
display the total tally in the #cbicount# variable:

cfquery name="Get" datasource="wweb"
   SELECT id, cbi
   FROM wweb
   Where cbi like 'CBI'

cfif cbi EQ "CBI"
   cfset cbicount + 1
/cfif

/cfquery

CFOUTPUT
#cbiCount#
/CFOUTPUT
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: passing cfquery results to another page

2000-12-07 Thread Hayes, David

You would have to copy the query to a scope that persists across pages.

Another option: you could cache the query so that the requery on the next
page will pull the cached version.  This could certainly cause some
problems; it will not be appropriate in many situations.

-Original Message-
From: sam sidhom [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 07, 2000 8:41 AM
To: CF-Talk
Subject: passing cfquery results to another page


Can anyone tell me if there is anyway CF will pass the results of a CFQuery
to another page without having to requery the database?

Thanks,

Jennifer Johnson
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: CF_SQL_DATE

2000-12-07 Thread Hayes, David

Are StartDate and EndDate ODBC date objects?

If not, it may be that you're telling SQL server to expect ODBC dates, but
you're not them.  (Whereas in your CFQUERY, SQL server is figuring out how
to handle that date data.)

What happens if you use value="#createODBCDate(createDate( month,day and
year from startdate))#"?

-Original Message-
From: sebastian palmigiani [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 07, 2000 10:52 AM
To: CF-Talk
Subject: "CF_SQL_DATE"



I am using CF 4.0 with MS SQL Server 7.0

Is there an issue with using  cfsqltype="CF_SQL_DATE" in a stored procedure?

I get the following error code while using a stored procedure

--
ODBC Error Code = S1C00 (Driver not capable)
[Microsoft][ODBC SQL Server Driver]Optional feature not implemented
--

I have isolated the problem to the following code

cfprocparam type="In"
 cfsqltype="CF_SQL_DATE"
 dbvarname="@StartDate"
 value="#StartDate#"
 
cfprocparam type="In"
 cfsqltype="CF_SQL_DATE"
 dbvarname="@EndDate"
 value="#EndDate#"

I have used the regular cfquery tag to do the same query with no problem.

Sebastian
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Radio buttons

2000-12-06 Thread Hayes, David

I haven't seen that before; are you able to duplicate the conditions?
Browsers, data input, etc?

Is the value really coming through with the "/" or is it "value1,value2"? 

Things to try:

1) Put commas around your INPUT attibute values, e.g. value="value1"

2) Verify that you don't have another form field with the same name (a
hidden one perhaps)

3) Verify that some javascript validation isn't setting both to checked OR
setting the value to both values

4) Output the raw form data (via debugging on as the first line of your
page) and verify you're not doing any server side modification.


-Original Message-
From: Jon Gage [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 06, 2000 10:05 AM
To: CF-Talk
Subject: Radio buttons


I'm having a problem with radio buttons in my form.  Sometimes when I post
the form, BOTH values of like-named radio buttons get passed.  Example:

ORIGINAL FORM
input type=radio name=CC value=VALUE1 CHECKED
input type=radio name=CC value=VALUE2

POSTING FORM
Form.CC will come up as "VALUE1/VALUE2"

Has anyone had this problem before?  It only happens *very* rarely on our
site, but it looks like it may be crashing the CF server.
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Multiple Multiple Selects in Query

2000-12-06 Thread Hayes, David

You'll have to loop through the form values at both the category and
subcategory levels.

Without more info on the inserts you are trying to do, I can only guess:

(psuedo-code)

loop through categories
insert into categories table values (loop.category)
loop through subcategories
Insert into subcategories table values(loop.category,
loop.subcategory)
/loop
/loop


-Original Message-
From: Rosa, Issac [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 06, 2000 12:16 PM
To: CF-Talk
Subject: Multiple Multiple Selects in Query


I have a form that has 2 multiple select list boxes.  I have the select
boxes set, but I can't figure out the query.  Say I pass from the form these
values category 1,2 and subcategory 1,2.  How do I Insert the values into a
database?  Any help or suggestions would be appreciated.



If you have any questions or concerns, please feel free to call me at
407-514-5021.

Thank you,

 Issac Rosa
 
 IT - National Sales  Marketing
 OLAP Specialist Team Leader
 Ofc: 407-514-5021
 Cell: 407-342-0644
 Fax: 407-514-5988
 [EMAIL PROTECTED]

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: What is Pragma?

2000-12-04 Thread Hayes, David

If you visit www.w3c.org, you can get more info than you ever wanted on the
HTTP protocol.

Here's a relevant excerpt:


14.32 Pragma

   The Pragma general-header field is used to include implementation-
   specific directives that might apply to any recipient along the
   request/response chain. All pragma directives specify optional
   behavior from the viewpoint of the protocol; however, some systems
   MAY require that behavior be consistent with the directives.

   Pragma= "Pragma" ":" 1#pragma-directive
   pragma-directive  = "no-cache" | extension-pragma
   extension-pragma  = token [ "=" ( token | quoted-string ) ]

   When the no-cache directive is present in a request message, an
   application SHOULD forward the request toward the origin server even
   if it has a cached copy of what is being requested. This pragma
   directive has the same semantics as the no-cache cache-directive (see
   section 14.9) and is defined here for backward compatibility with
   HTTP/1.0. Clients SHOULD include both header fields when a no-cache
   request is sent to a server not known to be HTTP/1.1 compliant.

   Pragma directives MUST be passed through by a proxy or gateway
   application, regardless of their significance to that application,
   since the directives might be applicable to all recipients along the
   request/response chain. It is not possible to specify a pragma for a
   specific recipient; however, any pragma directive not relevant to a
   recipient SHOULD be ignored by that recipient.

   HTTP/1.1 caches SHOULD treat "Pragma: no-cache" as if the client had
   sent "Cache-Control: no-cache". No new Pragma directives will be
   defined in HTTP.

  Note: because the meaning of "Pragma: no-cache as a response
  header field is not actually specified, it does not provide a
  reliable replacement for "Cache-Control: no-cache" in a response


ftp://ftp.isi.edu/in-notes/rfc2616.txt





-Original Message-
From: sknyppy [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 03, 2000 8:09 AM
To: CF-Talk
Subject: What is Pragma?


Could someone explain what this statement does? I assume it prevents caching
but how?
CFHEADER NAME="Pragma" VALUE="no-cache"

Thanks
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: normalization problem?

2000-12-04 Thread Hayes, David

Here's a couple of things to try:

1) Run your queries in a db tool (SQL Query Analyzer) to compare performance
of different statements AND to see how many records are being returned.
This will make your life easier.

2) Make sure all the fields you are joining on are indexed.

3) Try the TOP X language.

CFQUERY NAME="prize" DATASOURCE="SALES"
SELECT TOP 5 prize.value, draw.drawdate, 
  contest.contest_name, contest_type.contest_type, 
  state.state
FROM state, prize, draw, contest_type, contest, company
WHERE prize.draw_id = draw.draw_id 
AND draw.contest_id = contest.contest_id 
AND contest_type.contest_type_id = contest.contest_type_id
AND contest.company_id = company.company_id
AND company.state_id = state.state_id
ORDER BY prize.value DESC
/CFQUERY


4) TRY a subquery to reduce the number of records matched.

CFQUERY NAME="prize" DATASOURCE="SALES"
SELECT prize.value, draw.drawdate, 
  contest.contest_name, contest_type.contest_type, 
  state.state
FROM state, prize, draw, contest_type, contest, company
WHERE prize.draw_id = draw.draw_id 
AND draw.contest_id = contest.contest_id 
AND contest_type.contest_type_id = contest.contest_type_id
AND contest.company_id = company.company_id
AND company.state_id = state.state_id
AND prize.draw_id IN
(SELECT TOP 5 draw_id
FROM prize
ORDER BY value DESC)
ORDER BY prize.value DESC
/CFQUERY


In #3, all the records still need to be joined, then a subset is returned.

#4 is better because it limits the number of prize records the db needs to
join with other tables.

-Original Message-
From: Joseph Thompson [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 04, 2000 10:55 AM
To: CF-Talk
Subject: normalization problem?


With a fully "normalized" database (MS SQL Server 7 CF 4.51)
Is this the correct way to get the top 5 prize values and
associated details from a database?  

It returns an "out of memory/resource" error;
"Error Diagnostic Information Error occurred for unknown cause."

Any help would be appreciated : )

CFQUERY NAME="prize" DATASOURCE="SALES" MaxRows=5
SELECT prize.value, draw.drawdate, 
  contest.contest_name, contest_type.contest_type, 
  state.state
FROM state, prize, draw, contest_type, contest, company
WHERE prize.draw_id = draw.draw_id 
AND draw.contest_id = contest.contest_id 
AND contest_type.contest_type_id = contest.contest_type_id
AND contest.company_id = company.company_id
AND company.state_id = state.state_id
ORDER BY prize.value DESC
/CFQUERY

The Dbase structure is like this:

Prize Table:
-value
-draw_ID

Draw Table:
-drawdate
-draw_ID
-contest_id

Contest Table:
-contest_name
-contest_ID
-contest_type_ID
-company_ID

Contest_type Table:
-contest_type
-contest_type_ID

Company Table:
-company_ID
-state_ID

State Table:
-state
-state_ID
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Problem Matching Dates

2000-12-04 Thread Hayes, David

Turn on debugging and output the query; you'll see what values are actually
being passed to the db by cold fusion.  

You may have some luck if you make convert your form.date value to an
ODBCDate object (see createODBCDate function).

You could also try using the SQL CONVERT function to convert your text date
into a SQL date object, then do the comparison.

Or you could compare CONVERT(char,EventDate,101) with form.date.

Take a look at CONVERT.

-Original Message-
From: Chris Martin [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 04, 2000 1:19 PM
To: CF-Talk
Subject: Problem Matching Dates


Hey everyone.  I am working with sql server, and I am trying to match a date
to update a record.  Here is what I have:

cfquery name="qcfAddEventDates" datasource="FSLibrary_Dev"
UPDATE  dbo.tbl_EP_EventDateTime
SET EventDateStartTime = #local.startTime#,
EventDateEndTime =
#local.endTime#, EventScheduleNotes = '#Trim(form.dateNotes)#'
WHERE   EventID = #Trim(form.ID)#
AND DatePart(DD, EventDate) = DatePart(DD,
#Trim(form.Date)#)
AND DatePart(MM, EventDate) = DatePart(MM,
#Trim(form.Date)#)
/cfquery

I also tried:

cfquery name="qcfAddEventDates" datasource="FSLibrary_Dev"
UPDATE  dbo.tbl_EP_EventDateTime
SET EventDateStartTime = #local.startTime#,
EventDateEndTime =
#local.endTime#, EventScheduleNotes = '#Trim(form.dateNotes)#'
WHERE   EventID = #Trim(form.ID)#
AND EventDate = #Trim(form.Date)#
/cfquery
The problem is that it won't match any records.  I know the record is in the
database, because I checked to make sure.  Any ideas why this doesn't work?
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: a bbs in cf

2000-12-01 Thread Hayes, David

Look at the list functions and the string functions (help for all should be
in studio or one of the books; get one!)

For lists, you can use any character as a delimiter, so you can do
listLen("your number",".").  

If it's 1, you have a number of the form ; it it's 2, you have a number
of the form .; if you might have numbers of the form
..9, you'll have to check for "." in position 1 of the string.
AND if you have numbers in the form of 999.999.999 you'll have to deal with
that.  Bottom line, validate the form of the input before the following code
processes.


This was quick, ymmv --

cfoutput
cfset myValidatedNumberString = "123.994567857" !--- replace with your
own ---
cfset myListCounter = listLen(myValidatedNumberString,".")
cfset myVarCounter = 1
cfset currentPart = ""
cfloop index="part" from="1" to="#myListCounter#"
cfset currentPart = listGetAt(myValidatedNumberString,part,".")
cfif part EQ 1
cfset ws = setVariable("var_"  myVarCounter, currentPart)
cfset myVarCounter = myVarCounter + 1 
cfelseif part EQ 2
cfset toCount = (len(currentPart)/2) + (len(currentPart)
MOD 2)
cfloop index="startPosition" from="1" to="#toCount#" 
!--- if it's odd, you'll need to get that last single digit
---
cfset ws = setVariable("var_"  myVarCounter,
mid(currentPart,(startPosition*2)-1,2))
cfset myVarCounter = myVarCounter + 1

/cfloop
/cfif
/cfloop


cfloop index="counter" from="1" to="#evaluate(myVarCounter - 1)#"
var_#counter# = #evaluate("var_"  counter)#br
/cfloop
/cfoutput




-Original Message-
From: Jordie Fike [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 30, 2000 10:23 AM
To: CF-Talk
Subject: a bbs in cf


first a thank you to those that helped me with my "dates in a sql 
statement" problem .. it has taken me close to fruition on my current pet 
project .. but now I've run into another road block

My Immediate Problem:
can anyone point me in the proper direction so that I might be able to 
learn what specific functions that are available in CF to read the contents 
of strings/variables? What I need to accomplish is to take something of the 
form

1234.010203

and be able to break it up into

is_there_a_period = 1
var_1 = 1234
var_2 = 01
var_3 = 02
var_4 = 03

when I won't know the length of what's before or after the period. i.e. 
they might be of the form

12
or
1234
or
1234.01
or
1234.0102
etc.

I know I can find the presence of the period with

CFSET is_there_a_period = ListContains(#sort_key#, ".")

but I don't know how to find out how many characters there are to the right 
or left of the period if it does exist, and what the value of these 
individual characters on either side of the period are.

What I'm Up To:
A while back I implemented a BBoard written in Tcl on 
OuterBanksBeachGuide.com - it was written by Phillip Greenspun of MIT. It 
has served us well through it's 4 year life span, but lately I've had 
clients asking for something similar on their sites. The problem with 
continuing to use Phillip's board is that it requires an AOLServer backed 
hosting solution and they don't come cheap. So I went looking for something 
written in CF at a comparable price (did I mention that Phillip's app is 
open source) but wasn't able to find much .. so then I get the bright idea 
to try and port Phillip's board from Tcl to CF. I checked with Phillip to 
make sure he was OK with this idea and he assured me that he is. Although 
it is my hope to get this functional on my own .. I would like to turn this 
into an open source project of it's own.

If this is something that you feel you would like to be involved in or if 
you would like a copy once I get it working please feel free to email me 
direct .. just so long as you are charging for your time installing the 
application and not selling the app itself. If anyone knows that I am 
reinventing the wheel and that something like this is already available, if 
you would kindly email me a quick note to point me in the right direction I 
would greatly appreciate it.

Jordie Fike
Tech Admin
[EMAIL PROTECTED]
http://www.outer-banks.nc.us
phone - 1.252.441.6698
fax - 1.252.480.2259
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



  1   2   >