These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: how to use addScalar
PostPosted: Mon Aug 13, 2007 2:42 am 
Beginner
Beginner

Joined: Sat Mar 03, 2007 5:32 am
Posts: 20
in my database(MS SQL Server) my column datatype is datetime.

in my code when i do
Calendar fiveDays = Calendar.getInstance();
fiveDays.add(Calendar.DATE, -5); // get date for 5 days ago
String dtFiveDaysAgo= dateFormat.format(fiveDays.getTime())

String query = "Select enq.id as id," +
"enq.msg_text as msgText," +
"enq.email_addr as emailAddr," +
"enq.submit_user_id as submitUserId," +
"from threadings as enq where enq.last_modify_Date is null and enq.status=1 and "+
"enq.created_Date<='"+dtFiveDaysAgo+"'";


i receive the error:
syntax error in converting datetime from character string.

What is the correct way to do it?

thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.