Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

CAST Expression Error - Missing Operator

Posted on 1997-11-16
1
571 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
ID: 1089126
Hi,

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

(Hope this helped.)
Jim

0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

839 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