simple question about date compare

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jay123
    New Member
    • Sep 2008
    • 121

    simple question about date compare

    hi guys,
    i have a table with 2 columns as StartDate and Enddate.
    and i am writting a query in which one of the condition is
    where startdate < enddate ( means stardate can be 01/01/2009 and enddate as 09/01/2009 in dd/mm/yyyy format). as of this time with small database. its not at all a issue, but do u people think that in future when my database grows this style of comparing date can be a problem?

    any suggestions.
  • Delerna
    Recognized Expert Top Contributor
    • Jan 2008
    • 1134

    #2
    If you think your database will grow sufficiently that it will become an execution speed problem then you might want to put some thought into
    creating appropriate indexes on the fields that will give you the most effective performance boost in relation to your search conditions.

    Comment

    • ck9663
      Recognized Expert Specialist
      • Jun 2007
      • 2878

      #3
      Rather than using a function, yes. Comparative statement is still the fastest way to compare dates.


      --- CK

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32636

        #4
        Originally posted by jay123
        but do u people think that in future when my database grows this style of comparing date can be a problem?
        In direct response I would say "No." It shouldn't be a problem. As CK says, it's the best way to test this condition.

        Comment

        Working...