She also needs to add -24 not 24 otherwise it's going FORWARD 24 hours form
 today not BACK.

---------- Original Message ----------------------------------
From: "Andrew Scott" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date:  Tue, 19 Feb 2002 23:46:10 +1100

>Switch the 2 dates:-)
>
>-----Original Message-----
>From: Kay Smoljak [mailto:[EMAIL PROTECTED]] 
>Sent: Tuesday, 19 February 2002 3:04 PM
>To: SQL
>Subject: BETWEEN and date functions
>
>Hi all,
>
>I have the following query, trying to pull out login attempts that have
>occurred within the past 24 hours:
>
>SELECT attempt.pkAttempt
>FROM           attempt
>WHERE  attempt.ipaddress = '#cgi.remote_addr#'
>AND            attempt.type = '#attributes.type#'
>AND            attempt.dtAttempt 
>BETWEEN        DATEADD(hh,24,GETDATE())        
>AND            GETDATE()        
>
>It's not throwing an error, but it's not returning results that it
>definitely should be, either. Can anyone see where I'm going wrong? (SQL
>Server 2000)
>
>Thanks,
>Kay.
>______________________________________________________ 
>Kay Smoljak - ColdFusion Developer - PerthWeb Pty Ltd 
>  
>Level 9/105 St George's Terrace - Perth - Western Australia 
>Ph: (08) 9226 1366 Fax: (08) 9226 1375 www.perthweb.com.au
>
>http://developer.perthweb.com.au - Tools for Developers
>cfx_pwcamtech | cfx_pwimageproc | cfx_pwcardcyrpt
>               
>
> 
> 
>
>
______________________________________________________________________
Macromedia ColdFusion 5 Training from the Source
  Step by Step ColdFusion
  http://www.amazon.com/exec/obidos/ASIN/0201758474/houseoffusion
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to