Professional Web Applications Themes

find out who was online at a given time - PERL Beginners

Removed by Administrator...

  1. Moderated Post

    Default find out who was online at a given time

    Removed by Administrator
    Christopher Guest
    Moderated Post

  2. Moderated Post

    Default find out who was online at a given time

    Removed by Administrator
    Christopher Guest
    Moderated Post

  3. Moderated Post

    Default Re: find out who was online at a given time

    Removed by Administrator
    Philipp Guest
    Moderated Post

  4. Moderated Post

    Default Re: find out who was online at a given time

    Removed by Administrator
    Eric Guest
    Moderated Post

  5. #5

    Default Re: find out who was online at a given time

    From: com 

    Not sure what does mysql support but I'd try something like

    SELECT TOP 1 ID, FullName
    FROM the_table
    WHERE "IP address" = ?
    and Date = ?
    and Time <= ?
    and "Record Type" = "Start"
    ORDER BY Time Desc

    to get the start and

    SELECT TOP 1 ID, FullName
    FROM the_table
    WHERE "IP address" = ?
    and Date = ?
    and Time >= ?
    and "Record Type" = "Stop"
    ORDER BY Time Asc

    to get the end. If the first select doesn't return any row you will
    need to requesry the database with something like this:

    SELECT TOP 1 ID, FullName
    FROM the_table
    WHERE "IP address" = ?
    and Date = DATEADD( day, -1, ?)
    and "Record Type" = "Start"
    ORDER BY Time Desc

    if the second doesn't return a row you'd use

    SELECT TOP 1 ID, FullName
    FROM the_table
    WHERE "IP address" = ?
    and Date = DATEADD( day, 1, ?)
    and "Record Type" = "Stop"
    ORDER BY Time Asc

    It would be enough to find the start, but I think it's better to find
    both and compare the FullName just to make sure you found the right
    person.

    HTH, Jenda
    ===== cz === http://Jenda.Krynicky.cz =====
    When it comes to wine, women and song, wizards are allowed
    to get drunk and croon as much as they like.
    -- Terry Pratchett in Sourcery

    Jenda Guest

Similar Threads

  1. Find component in ASP.NET form at run-time
    By Sean Winstead in forum ASP.NET Building Controls
    Replies: 2
    Last Post: September 30th, 01:36 PM
  2. How to find out time on site ??
    By Jim Cheshire [MSFT] in forum ASP.NET General
    Replies: 2
    Last Post: August 1st, 10:18 PM
  3. Find time consuming SQL statements
    By Arthur Groen in forum Informix
    Replies: 0
    Last Post: August 1st, 07:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139