Dear Imran,

Let us assume table1 and table2 has common field as id

select * from table1 as tb1, table2 as tb2 where
(tb1.date_format(tb1.tabledatefield,'%Y-%m-%d')
between '$fromDate' and '$toDate') or
(tb2.date_format(tb2.tabledatefield,'%Y-%m-%d')
between '$fromDate' and '$toDate');

I hope the above query will give correct output.
$fromDate and $toDate must be YYYY-MM-DD format.

otherwise try it by changing
date_format(tb.datefield,'%d/%m/%Y')

If both gives wrong output just make it as follows:

date_format(tb.datefield,'%Y%m%d')

and $fromDate & $toDate in YYYYMMDD format.


Thanks and regards,
Arun

--- imran shafiq <[EMAIL PROTECTED]> wrote:


---------------------------------
Hi
Can any one solve my problem?
How to retrive certain records from MySQL's more than
two table b/w two dates.
For example
If we want the records who's date is b/w 12/12/2004 to
12/12/2005 
Waiting for your responce
Imran Sahfiq


            
___________________________________________________________

To help you stay safe and secure online, we've
developed the all new Yahoo! Security Centre.
http://uk.security.yahoo.com


Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list

      

      SPONSORED LINKS  
                                                Php
mysql                                    Job postings 
                                     
    
---------------------------------
  YAHOO! GROUPS LINKS

  
    Visit your group "php-list" on the web.
   
    To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
   
    Your use of Yahoo! Groups is subject to the Yahoo!
Terms of Service.

  
---------------------------------





                
__________________________________________________________ 
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/HKFolB/TM
--------------------------------------------------------------------~-> 

Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




Reply via email to