Web Analytics Made Easy -
StatCounter query in a range? - CodingForum

Announcement

Collapse
No announcement yet.

query in a range?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • query in a range?

    I have the fields

    (start_time, end_time) in a table.

    is there a way where i can make a query to test if a value of time x is within the range between start_time and the end_time?

    (start_time <= x >= end_time)

    how can i structure this query?

    i am using mysql version 4.0.4

    thanks

  • #2
    SELECT var1 FROM table WHERE '2004-02-27' BETWEEN start_time AND end_time

    or for the current date

    SELECT var1 FROM table WHERE Now() BETWEEN start_time AND end_time
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

    Comment

    Working...
    X