Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error with date field in SQL link server
Message
From
25/06/2010 16:33:53
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01470562
Message ID:
01470619
Views:
41
>Hi,
>
>We are getting below error while running a query to show the date type data in SQL Server 2008.
>
> Msg 8114, Level 16, State 8, Line 1
> Error converting data type DBTYPE_DBTIMESTAMP to datetime.
>
>Sample Query:
> SELECT code, name, age, dob, doj
> FROM [open_rowset]...[emp_data]
>
> NOTE: dob & doj are date type fields.
>
>
>Thanks In Advance
>Ravi Mehrotra

SQL server doesn't have an understanding of empty dates while VFP has. You can use openquery instead. ie:
Select * from OpenQuery( VFPLINKEDSERVER,
  'SELECT code, name, age, cast(evl(dob, null) as date) as dob, doj FROM emp_data')
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform