Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to specify date range for query (VFP9 OleDB)
Message
From
03/03/2006 13:05:39
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01099668
Message ID:
01101322
Views:
10
John,

I'm guessing it's an OleDb problem, but I use SQL Server as my database, so I'm not sure what limitations, if any, there are in the VFP OleDb. There was a thread here just this week that was something about problems with different VFP OleDb versions and I think it even have had something to do with dates. You should do a quick search and see if you can find it. (I don't remember if it was here in the .NET forum or if it was in the VFP forum, so check both places).

Another thought ... do you need the time as well as the date? If not, maybe you can get rid of the time portion and see if that makes any difference.

~~Bonnie


>Thanks Bonnie, that gets me closer, but still no cigar. The expression now comes out as
>
>between(s.sdate1,'7/1/2004 12:00:00 AM','7/8/2005 12:00:00 AM')
>
>and I'm getting the same error.
>
>I remember hearing about a VFP Toolkit for .NET that's supposed to ease the transition - think I'll dig that up and see if there might be something in there that would help.
>
>I appreciate your suggestions. I'm just learning ASP.NET with this one app, and while I was initially blown away by how much easier it is than classic ASP there are things like this that have me banging my head against the wall.
>
>John
>
>
>>It's been awhile since I've done anything with VFP, so I don't know if this is legit, but can you delimit with quotes instead of {}? If so, you'd have this instead:
>>
>>   dim MySql as string = String.Format("select s.sdate1,s.sdate2,s.Location,c.cTitle,e.hours " & _
>>       "from dtrSess s join dtrEnroll e on e.scode=s.scode join dtrCourse c on c.ccode=s.ccode " & _
>>       "where e.id_code= {0} and between(s.sdate1,'{1}','{2}')", Request.Item("ID"),dRdate1,dRdate2)
>>
>>
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform