Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004

    Question Unanswered: Query it take too match

    i am using MS-Access and when fire following Query it take too match

    to fetch the Data . can u help me to tune this query

    table Structure is
    create table Market_Price (companyID number ,Ondate datetime , BSEClosing number ,NSEClosing number);

    Query is:=

    SELECT Distinct(MP1.OnDate), Format(MP1.OnDate,'DD-MMM-YYYY') as DDate, MP1.NSEClosing as Closing, LOG( MP1.NSEClosing / MP2.NSEClosing) as ui, LOG( MP1.NSEClosing / MP2.NSEClosing)* LOG( MP1.NSEClosing / MP2.NSEClosing) as ui2 FROM Market_Price MP1,Market_Price MP2 WHERE MP2.OnDate=(SELECT Max(OnDate) from Market_Price WHERE OnDate < MP1.OnDate) AND MP1.OnDate between cdate('1-Jan-2003') AND cdate('21-Jan-2003') AND MP1.CompanyID=47 ORDER BY MP1.OnDate;

    number of record 1500 only

  2. #2
    Join Date
    Jan 2004
    The Netherlands
    SELECT Max(OnDate) from Market_Price WHERE OnDate < MP1.OnDate

    That subselect is the killer, but dont know how to fix it off hand...

Posting Permissions

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