Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Functions and & SQL Server ODBC
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00395707
Message ID:
00395722
Views:
9
>We are creating views against a SQL Server and have encountered new thing (go figure). In the SQL server, there is a datetime field and we tried to setup a VFP view to pull just the date portion in the view:
>
>ttoc(subs(record_datetime,1,10)) as JustDate
>
>When we attempt to run the view, we get an ODBC error saying function ttoc not found, if we try just substring() we get a conversion error, but if we do left(record_datetime,1,10) it works returning a character field.
>
>I just thought there may be a posting somewhere that list valid command you can use in a remote view.
>
>Thanks for any help.
>Kirk

As Al said, you have to SQL commands. If you're looking for books, I recommend the Database Professional's Library from Osborne.

There is no such thing as a date field or data type in SQL Server, AFAIK. Everything is datetime. You can convert a datetime into a charater field with only the date or time part using the CONVERT function.

CONVERT(CHAR(10),record_datetime,101) && converts to 10 characters (date only) with 4-digit year
CONVERT(CHAR(8),record_datetime,108) && converts to 8 characters (time only)
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform