Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. articles. downloads. faq. members. files. rss.
 From: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 To: Andy Kramek
  Where is Andy Kramek?
 Hot Springs Village
 Arkansas - United States
 Andy Kramek
Subject: RE: Need help with date parameter in view
Thread ID: 105196 Message ID: 105252 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Friday, August 25, 2006 2:33:10 PM         
   



> > Hello,
> >
> > I am attempting to use a local parameterized view with a date field for the parameter without any luck.
> > I am using Orders.shpdate >= {?dStart_Date} for the filter.
> >
> > This prompts for the date but does not result in a filter set. All of the records are presented.
> >
> > Is there some trick to using a date field as the parameter?
> >
> > Thanks for any suggestion.
> >
> > Judi

>
> Unfortunately you cannot do this. The InputBox (which is what is popped up for the parameter) returns a literal string, so you can only pass a character string or a numeric value through it. The way to handle a date is to create a little pop-up form to return the date parameter as a date and call it before you need the parameter so that it is already in scope when the view runs.
>
> Sorry, but I don't know of any other way to do it reliably.
>
> Regards
> Andy Kramek
> Microsoft MVP (Visual FoxPro)
> Tightline Computers Inc, Akron Ohio, USA


Andy

Whereas your way is the only way to do it, it tried the method below at it actually worked

SQLEXEC(2,'select * from grr where date=?y::timestamp')

have to put the date in quotes in yyyy-mm-dd format. my backend was postgresql. but i would never use it in production.

Tushar

ENTIRE THREAD

Need help with date parameter in view Posted by Judi Hudgins @ 8/24/2006 5:47:44 PM
RE: Need help with date parameter in view Posted by Ken Murphy @ 8/24/2006 6:06:59 PM
RE: Need help with date parameter in view Posted by Judi Hudgins @ 8/24/2006 6:35:05 PM
RE: Need help with date parameter in view Posted by Andy Kramek @ 8/25/2006 12:30:54 PM
RE: Need help with date parameter in view Posted by Martin Sellwood @ 8/25/2006 1:49:55 PM
RE: Need help with date parameter in view Posted by Andy Kramek @ 8/25/2006 2:37:00 PM
RE: Need help with date parameter in view Posted by Martin Sellwood @ 8/25/2006 2:42:10 PM
RE: Need help with date parameter in view Posted by Judi Hudgins @ 8/25/2006 2:26:31 PM
RE: Need help with date parameter in view Posted by tushar @ 8/25/2006 2:33:10 PM
RE: Need help with date parameter in view Posted by Andy Kramek @ 8/25/2006 2:41:15 PM
RE: Need help with date parameter in view Posted by tushar @ 8/26/2006 7:44:06 AM