I guess what I'm saying is that before I add this current record, is there already one in there?  So then wouldn't it be GT 0?

> Do you mean "I want to be sure that there are _NO_ duplicates" ??
> If so, then your <cfif ...> statement ought to read add_check.
> recordcount GT _1_ (not 0)
> Of course you may want to know if your form fields yield 0 results.
> A quick-n-dirty way to see if there are dupes would be to run 2
> queries
> (qry 1: select * and qry 2: select distinct *) and check the
> 'myquery.recordcount' for each (if the recordcounts are equal, then
> you
> may assume that there are no dupes.
>
> hth, -mike
>
>
>
>
>
> Daniel Kessler <[EMAIL PROTECTED]>
> 07/15/2004 02:00 PM
> Please respond to cf-talk
>


>
        
> To:     CF-Talk <[EMAIL PROTECTED]>
        
> cc:
        
> Subject:        repeat record in query
>
>
> I have an alumni database and I want to be sure that there are
> duplicate people.  I have alot of information to do a compare, but I
> don't want to limit it to first name/last name.  Also, the query that
>
> I've been doing seems say there's a duplicate when there isn't so I
> wanted to be sure I was doing this correct.
>
> <cfquery name="add_check" datasource="ch">
      
> SELECT firstname,middlename,lastname,address FROM alumni_contacts
      
> WHERE firstname = '#Form.firstname#' AND middlename =
> '#Form.middlename#' AND lastname = '#Form.lastname#' AND
> address='#Form.address#'
> </cfquery>
>
> <cfif add_check.recordcount GT 0>
      
> <cflocation url=""> > </cfif>
> --
> Daniel Kessler
>
> Department of Public and Community Health
> University of Maryland
> Suite 2387 Valley Drive
> College Park, MD  20742-2611
> 301-405-2545 Phone
> www.phi.umd.edu
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to