Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remote view datetime filter
Message
From
24/01/2012 14:59:15
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01533628
Message ID:
01533648
Views:
66
>>I have created a VFP9 view to get data from MS-SQL Server 2005. I want to filter records for a datetime filed. I have written datetime value like {^2011-01-01 00:00:00} but it does not accept. Any idea please. I do not want to use local view after it to make filter.

If you use a parameterized VFP view, an ordinary VFP date or datetime value should work fine against a datetime field. You don't need to mess with conversions.
View: select * from dbo.mytable where sqldateval<=?MyVal

MyVal=datetime()
requery()

MyVal={^2011-01-01}
requery()
Don't make it a string, make the parameter an actual VFP date or datetime value and requery the view.
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Previous
Reply
Map
View

Click here to load this message in the networking platform