This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes cast a date from an access date/time field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "cast a date from an access date/time field" Watch "cast a date from an access date/time field" New topic
Author

cast a date from an access date/time field

Mikealan Smith
Greenhorn

Joined: Aug 29, 2003
Posts: 15
I'm trying to retrieve data from an ACCESS database. I have an sql statement that looks like
String query = "select * from AuditTrail where CAST(LOGDATE AS DATE) = current_date";
I get the following error

sqlstate 37000

detailMessage= "[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'cast(logdate as Date)'."

Can someone tell me what i'm doing wrong please?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cast a date from an access date/time field
 
It's not a secret anymore!