Date Ranges???

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NateDogg
    New Member
    • Apr 2007
    • 5

    #1

    Date Ranges???

    I am trying to pull back records for a specific date range. I have an effectivedate column that I am using. But I am finding that this isnt working as I originally thought it was going to.

    My initial thought was to just add a couple of parameter fields to part of the SQL where clause would look something like this:
    (effectivedate >= {?pfld_BegDate} and effectivedate <= {?pfld_EndDate} )

    This doesn’t work. Here is an example: If my date range is 1/1/07 to 4/1/07 it will only look for effective dates between this window. So if there was a row that has an effective of 12/1/06, it would not display as the effective date is not between the date range. Even though it is an effective row between this time frame.

    Any ideas?
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    i may not understand but I think you are trying to use dates as flags within a table and pull out all data between the flags. Well it is a database and not a spreadsheet so the row arrangement is meaningless. You need an extra field, probably autonumber, then you can use this field for your flags, and still reference the dates

    Comment

    • mklprasanna
      New Member
      • Apr 2007
      • 10

      #3
      Hi,

      I think your asking to get the data between the begining date and ending date.
      and in your sql where condition syntax is what you wrote is wrong.
      Are you using PHP to execute this query.
      if yes,
      $pfld_BegDate=" 2007/01/01";
      $pfld_EndDate=" 2007/01/04";
      "(effective date >=".$pfld_BegDa te." and effectivedate <=".$pfld_EndDa te.")"
      Try it.I think you will definetly get the result.

      Comment

      Working...