Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server DateTime and Visual FoxPro
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
SQL Server DateTime and Visual FoxPro
Miscellaneous
Thread ID:
00883463
Message ID:
00883463
Views:
49
I am using VFP 6.0 as a front end and SQL Server 2000 as a back end, with SQL passthru. I want to allow the user the ability to enter a date range in the format of 01/01/01 as an example. The SQL Server fields are of type DateTime. The following code works but seems like a bandage. Is there a “better” or different way to do this?

An example of code follows:
local  ldBeginDate, ldEndDate

ldBeginDate = Thisform.txtBeginDate.Value
ldEndDate = Thisform.txtEndDate.Value

ldBeginDate = ldBeginDate  + " 00:00:00 AM"
ldEndDate = ldEndDate  + " 12:59:59 PM"

SQLEXEC(tConnection, 'SELECT * FROM LineCall ;
 					where datecreated >= ?ldBeginDate ;
 					and datecreated <= ?ldEndDate ', 'cuLineCall')
Thank you for any suggestions.
Next
Reply
Map
View

Click here to load this message in the networking platform