Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: RE: Counting Records added during previous ho ur.


Message #1 by Martin Lee <access@o...> on Wed, 01 May 2002 21:24:05 +0800
Thanks Col:

the system clock was not inserting the AM/PM with the date/time. Fixed that 
and your suggestion worked fine.

Thanks,

Martin

At 01:55 PM 4/30/2002 +0100, you wrote:
>not sure what's happening Martin, but i've got this working:
>
>SELECT ADMINConnectedUsers.UserID, ADMINConnectedUsers.ConnStartTime
>FROM ADMINConnectedUsers
>WHERE (((DateDiff("n",[ADMINConnectedUsers]![ConnStartTime],Now()))<60));
>
>This is in an Access 97 DB but I don't see it being different in 2000 (bit
>awkward to check at the moment).  See if you can get this working with your
>qry and let me know how you get on.
>
>HTH,
>Col
>
>-----Original Message-----
>From: Martin Lee [mailto:access@o...]
>Sent: 30 April 2002 12:36
>To: ASP Databases
>Subject: [asp_databases] RE: Counting Records added during previous
>hour.
>
>
>
>Have been trying work out something with DateDiff but I must be missing
>something; just cannot understand the values being returned.
>
>Using the following data as an example:
>
>FailedDate = 4/30/2002 4:33:33
>
>Current Time =4/30/2002 7:29:01
>
>When I run the following  - TimeElapsed:
>DateDiff("n",[tblFailedLogins.FailedDate],Now())
>
>Access returns 896
>
>Any ideas???
>
>Thanks,
>
>Martin
>
>At 10:59  4/30/2002 +0100, you wrote:
> >Assuming you've got a "Logins" table, which records the time of each Login
> >in a field called "Time", your query will prob be something like this (I
> >haven't been able to check it):
> >
> >strSQL = "SELECT Count(tblFailedLogins.FailedId) AS FailedLogins " _
> >           & "FROM tblUsers INNER JOIN tblFailedLogins ON " _
> >           & "tblUsers.UserName = tblFailedLogins.FailedUserName " _
> >           & "WHERE (((tblUsers.UserName)= '" & strUserName & "')) AND " _
> >           & "(TimeElapsed: DateDiff("n", [tblLogins.Time], now())) < 60;"
> >
> >Have a look on the web for Access AND DateDiff - Access 2000's Help is a
> >little sketchy on it.
> >
> >HTH,
> >Col
> >
> >-----Original Message-----
> >From: Martin Lee [mailto:access@o...]
> >Sent: 30 April 2002 09:46
> >To: ASP Databases
> >Subject: [asp_databases] Counting Records added during previous hour.
> >
> >
> >Good Afternoon all:
> >
> >would appreciate any help on selecting records added during the previous
> >hour.
> >
> >The below SQL query works fine at selecting total number of records but
> >need to only return count of records where tblFailedLogins.FailedDate 
> >previous hour.
> >
> >This is using Access 2000.
> >
> >SQL = "SELECT Count(tblFailedLogins.FailedId) AS FailedLogins"
> >SQL = SQL & " FROM tblUsers INNER JOIN tblFailedLogins ON"
> >SQL = SQL & " tblUsers.UserName = tblFailedLogins.FailedUserName"
> >SQL = SQL & " WHERE (((tblUsers.UserName)= '" & strUserName & "')); "
> >
> >Thanks
> >
> >Martin
> >
> >
> >
> >
> >*******
> >
> >This message and any attachment are confidential and may be privileged or
> >otherwise protected from disclosure.  If you are not the intended
> >recipient, please telephone or email the sender and delete this message
> >and any attachment from your system.  If you are not the intended
> >recipient you must not copy this message or attachment or disclose the
> >contents to any other person.
> >
> >For further information about Clifford Chance please see our website at
> >http://www.cliffordchance.com or refer to any Clifford Chance office.
> >
> >
>
>
>
>
>*******
>
>This message and any attachment are confidential and may be privileged or 
>otherwise protected from disclosure.  If you are not the intended 
>recipient, please telephone or email the sender and delete this message 
>and any attachment from your system.  If you are not the intended 
>recipient you must not copy this message or attachment or disclose the 
>contents to any other person.
>
>For further information about Clifford Chance please see our website at 
>http://www.cliffordchance.com or refer to any Clifford Chance office.
>
>


  Return to Index