Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to extract data from sql server db
Message
 
To
25/09/2002 17:05:21
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00704486
Message ID:
00704504
Views:
21
Hi Munish,

>sSql = "select * from abc where YEAR(calltime)=2002 AND MONTH(CALLTIME)=10 AND day(calltime)=20 INTO TABLE TEMPTABLE"

Obviously you've already gotten the answer. YEAR() and MONTH() are VFP functions and do not exist on SQL Server.

This is one of the reasons I'm NOT a big fan of SQL Passthrough and prefer to use stored procs for all data access and updates.

VFP compiles your code just fine because all it sees is a string even through the code is not correct. If you had a stored proc on the server, you would code it, test it, and then call it from VFP. Any changes to the stored proc would be automatically incorporated into your app and would NOT require a rebuild or redistribution of an EXE.

Just my $0.02...
Jim Duffy
Microsoft MVP
INETA Speaker
TakeNote Technologies
Developer's Choice Award Winner for Best Training Company
Specializing in VB.NET, ASP.NET, VFP, and SQL Server Training and Development
Previous
Reply
Map
View

Click here to load this message in the networking platform