Results 1 to 3 of 3

Thread: Inbetween...

  1. #1
    Lively Member Joffies's Avatar
    Join Date
    Aug 02
    Location
    London
    Posts
    119

    Inbetween...

    Good Day.

    I wanna search for records between to dates. What is the fastest and most efficient way of doing this seeing that i use a database of almost 200000 thousand records. What would be the correct sql statement to use....?

    Thanks in advance..
    Do, or do not. There is no 'try'.

  2. #2
    Fanatic Member Gary.Lowe's Avatar
    Join Date
    May 00
    Location
    In my sphere of influence
    Posts
    621
    Joffies

    Firstly create an index on these date fields and then use something similar to the following


    [Field] Between [From Date] AND [To Date]

    Depending on what database you are using you may have to add # on the begining and end of the date search criteria
    Gary Lowe
    VB6 (Enterprise) SP5
    ADO 2.6
    SQL Server 7 SP3

    OK I know my spelling and grammer is crap so don't quote me on it!

    To err is human to take the P! is only natural !!

    Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip


  3. #3
    Frenzied Member PilgrimPete's Avatar
    Join Date
    Feb 02
    Posts
    1,313
    If you've got a database with 200 million records then you might also want to think about 'horizontally partioning' your table. That'll have a significant impact on performance - especially if you store each partition on a separate box...

Posting Permissions

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