Solved

CAST Expression Error - Missing Operator

Posted on 1997-11-16
1
554 Views
Last Modified: 2012-05-04
I am getting the following error when executing a CAST in my SQL statement:
[ODBC][Microsoft dBase Driver]Syntax Error (missing operator) in query 'CAST (STARTDATE AS DATE)'

My SQL statement is:
SELECT CAST (STARTDATE AS DATE) AS ENDDATE FROM {Table}

According to all my books, this is correct.  STARTDATE is a
date in string format (mm/dd/yy)  What "missing operator" is the MS driver looking for?

Thanks!
 -Brent
0
Comment
Question by:da5id111697
1 Comment
 
LVL 2

Accepted Solution

by:
Jim_SQL earned 50 total points
Comment Utility
Hi,

TRY:
select convert(datetime, STARTDATE) as EndDate
from TableName

(Hope this helped.)
Jim

0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now