Solved

CAST Expression Error - Missing Operator

Posted on 1997-11-16
1
576 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
[X]
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
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

756 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