SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    I'm not a human
    Join Date
    Aug 2006
    Location
    India
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to get data between the two dates?

    hi

    i'm using the between operator to list all the transaction between the dates and it's working fine.

    But i want to list all the transaction from a table including the startdate and the enddate.

    What should i do??????
    Regards,
    Vijay
    Follow me on twitter @vijaycbe
    World Holiday Calander || My Cricket Blog

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    i think you should post more information
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Member maksimovic's Avatar
    Join Date
    Jul 2006
    Location
    Novi Sad, Serbia
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you want to INCLUDE records containing start & end dates, "where" clause should be something like this:

    ...where YourDateField >= 'start' and YourDateField <= 'end'

    not quite sure if this is what you need, and, yes, you should have posted more details

  4. #4
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    BETWEEN is inclusive of both endpoints (equivalent to >= and <=). Careful comparing dates to datetimes/timestamps though... when a date is converted to a datetime, it's taken at time 00:00:00, so nothing occuring on that day would be included in the results.


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
  •