Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Vivek Deodhar
  Where is Vivek Deodhar?
 SANGLI
 India
 Vivek Deodhar
 To: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 Tags
Subject: RE: date range selection from mysql table
Thread ID: 373314 Message ID: 373463 # Views: 32 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Friday, March 22, 2013 9:04:18 AM         
   


> > Dear Experts,
> >
> > I have a date type field in my remote mysql databse table.
> >
> > emidate (date type)
> >
> > When i issue this command it it dont fetch the required data form the
> > remote database table nor it gives any error message.
> > default i kept as '0000-00-00'
> >
> > *
> > SQL_COMMAND="SELECT * FROM EMI WHERE RCPT_DATE >='01-09-2013' AND RCPT_DATE <='30-09-2013'"
> >
> > IF SQLEXEC(CONNECTION_VAR,SQL_COMMAND,"MYSQLEMI")>0
> > SELECT MYSQLEMI
> > BROW
> > ENDIF
> >
> > my object is to fetch all records for the month of September from emi table.
> > Moreover i want that no blank date fields are included which fall in this given date range.
> >
> > Please help me how to acheive this.
> >
> > Regards.
>
>
>
SELECT * FROM Emi WHERE YEAR(rcpt_date)=2013 AND MONTH(rcpt_date)=9 
> 

> works with date and datetime data type.
> -Anders

This is not optimizable query. "between" function would optimize it and is therefore advisable.

Vivek

Live wisely... because in real world, there is no Ctrl + Z!

ENTIRE THREAD

date range selection from mysql table Posted by sangeeta yadav @ 3/21/2013 8:17:38 AM
RE: date range selection from mysql table Posted by Vivek Deodhar @ 3/21/2013 8:35:14 AM
RE: date range selection from mysql table Posted by Tore Bleken @ 3/21/2013 9:02:58 AM
RE: date range selection from mysql table Posted by Anders Altberg @ 3/21/2013 7:44:55 PM
RE: date range selection from mysql table Posted by Vivek Deodhar @ 3/22/2013 9:04:18 AM