Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Am I tired ?
Message
From
11/02/2008 12:12:04
 
 
To
09/02/2008 08:28:08
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01291041
Message ID:
01291518
Views:
9
>e.Day.Date.AddDays(1).ToString("dd-MMM-yyyy") + "'";

I bet that will cause string values like 31-JAN-2008 and 01-FEB-2008 and these strings are bad for date comparison, aren't they? You could change the whole thing to query the vfp way of date constants, that is: {^yyyy-mm-dd}.

So ...ToString("{^yyyy-MM-dd}") should work for you to prepare the dates as date constant in the query, which vfp handles as date values.

Also see

http://msdn2.microsoft.com/en-us/library/8kb3ddd4.aspx for how to use ToString and
http://fox.wikis.com/wc.dll?Wiki~VFPSQL-TSQL-Mapping~VFP for mappings of T-SQL (which may be more familiar) to VFP SQL.

example vfp sql:

select * from sometable where somedatefield between {^2008-01-01} and {^2008-12-31}

Bye, Olaf.
Previous
Reply
Map
View

Click here to load this message in the networking platform