Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Database View
Message
 
 
To
13/12/2004 12:14:37
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00968799
Message ID:
00968803
Views:
9
I don't see where you're creating a view. Your select is run against local VFP data and VFP7 doesn't have CAST() function. You can try CTOT() or DATETIM() instead.

>I'm trying to create a view based on a string and using the Execscript function, but it's not working and I don't know why. The error message is Syntax Error on the execscript function. Please take a look...
>
>
>	LOCAL lcScript, lcStartDate, lcEndDate
>	IF USED("deliveries")
>		SELECT deliveries
>		USE
>		DROP VIEW deliveries
>	ENDIF
>	lcStartDate = ALLTRIM(STR(YEAR(Session.startdate))) + "-" + 
ALLTRIM(STR(MONTH(Session.startdate))) + "-" + 
ALLTRIM(STR(DAY(Session.startdate))) + ' 00:00:00'
>	lcEndDate = ALLTRIM(STR(YEAR(Session.EndDate))) + "-" + 
ALLTRIM(STR(MONTH(Session.EndDate))) + "-" + 
ALLTRIM(STR(DAY(Session.EndDate))) + ' 00:00:00'
>	lcScript = "SELECT * FROM Deliveries WHERE Deliveries.deliverydate >= cast('" + 
ALLTRIM(lcstartdate) + "' as datetime) AND deliveries.deliverydate <= cast('" + 
ALLTRIM(lcenddate) + "' as datetime)"
>	EXECSCRIPT(lcScript)
>	IF !USED("deliveries")
>		USE deliveries IN 0
>	ENDIF
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform