>>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