Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Datetime fields in MSSQL as Date in VFP
Message
From
07/12/2009 21:04:29
 
 
To
07/12/2009 17:44:04
Hong Yew
People Quest
Malaysia
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01437969
Message ID:
01437993
Views:
55
Hi Yew,

in addition to James' suggestion of using datepart in the query, SQL2008 does in fact have a date column type: http://www.sqlteam.com/article/using-the-date-data-type-in-sql-server-2008. Since you are using SPT, you are probably not updating the cursor (by setting the cursor properties to support buffering, etc.), so datepart ought to work for you.

hth,

Hank

>Hi all
>
>My app is using MSSQL as DB. I need to create a cursor using SPT.
>
>Is there a way to convert datetime fields in MSSQL as date field in VFP cursor?
>
>Right now I have to do another SELECT with TTOD but this will slow performance as my cursor has some 300,000 records.
>
>I have tried the various CONVERT and CAST but there end up as Char field in VFP cursor.
>
>Is there any way to directly convert datetime fields to date fields with SQL Pass Thru?
>
>Your assistance and advice is really appreciated.
>
>Thanks & Best Regards
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform