Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: mk sharma
  Where is mk sharma?
 mumbai
 India
 mk sharma
 To: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 Tags
Subject: RE: Expiry List Report
Thread ID: 331303 Message ID: 331310 # Views: 31 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Wednesday, December 28, 2011 7:59:07 PM         
   


Thanks,

> >
> > you can try like this with SQLEXEC()
> >
> >
> > local ldtoday, ldmaxdate
> > ldtoday=date()
> > ldmaxdate=ldtoday+180
> > LOCAL lnConn
> > * Make connection, assuming a local trusted connection.
> > lnConn = SQLCONNECT('local')
> > IF m.lnConn > 0  && Success.
> >    * Execute SELECT statement.
> >    SQLEXEC(m.lnConn, 'select * from yourtable where between(expiry,ldtoday,ldmaxdate)', 'junkexpiry')
> >    BROWSE
> > endif
> > 
> > 

> >
> > Warm Regards,
> > mk.
>
>
> Does MySQL have a Between() function? If not, I'd try the SQL Standard "Between" in a parameterized way like
>
>
> ... Where expiry Between ?m.ldtoday And ?m.ldmaxdate ...

Yes, From Today to Today+180 Days.

>
> * On the other hand, why not also retrieve rows that have an "expiry" before today if any?
> ... Where expiry < ?m.ldmaxdate ...

Above (... Where expiry < ?m.ldmaxdate ... ) will select all the expired product upto ldmaxdate.
Not useful, every time Show the Old expired products.
he want only Future expiry products. (From Today to 6 Months)
i think he want this report for submit a claim to Manufacturer or distributor.(or to return the near expiry products to the Supplier)

>
>
>
>
> hth
> -Stefan



Warm Regards,
mk.

ENTIRE THREAD

Expiry List Report Posted by John Hayna @ 12/28/2011 6:53:36 PM
RE: Expiry List Report Posted by mk sharma @ 12/28/2011 7:14:36 PM
RE: Expiry List Report Posted by Stefan Wuebbe @ 12/28/2011 7:40:19 PM
RE: Expiry List Report Posted by mk sharma @ 12/28/2011 7:59:07 PM
RE: Expiry List Report Posted by John Hayna @ 12/28/2011 7:50:05 PM
RE: Expiry List Report Posted by mk sharma @ 12/28/2011 8:07:52 PM
RE: Expiry List Report Posted by John Hayna @ 12/28/2011 8:52:08 PM
RE: Expiry List Report Posted by mk sharma @ 12/28/2011 8:55:39 PM
RE: Expiry List Report Posted by Stefan Wuebbe @ 12/28/2011 7:17:50 PM
RE: Expiry List Report Posted by John Hayna @ 12/28/2011 7:51:33 PM
RE: Expiry List Report Posted by John Hayna @ 12/28/2011 8:44:15 PM
RE: Expiry List Report Posted by Stefan Wuebbe @ 12/28/2011 9:17:21 PM
RE: Expiry List Report Posted by tushar @ 12/29/2011 5:35:37 AM