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: Convert function missing ?
PostPosted: Fri Oct 10, 2008 7:08 am 
Newbie

Joined: Tue Aug 26, 2008 7:25 am
Posts: 12
Hello,

I don't find the ANSI SQL CONVERT function defined in any MS SQL dialect.

I'm trying to create the folowing statement using ICriteria:

SELECT CONVERT(datetime,
Str(Year (TIME)) + '-' +
Str(Month(TIME)) + '-' +
Str(Day (TIME)) +
' 00:00:00', 120) AS StartTime
FROM ...


I know a can use the CAST function which is registered in MSSql2000 Dialect but in my case it is not enough as CAST do not supply a 'style' argument as CONVERT does.

Please give me a solution to this. I saw that in Hibernate there is a 'org.hibernate.dialect.function.ConvertFunction' as well as a 'org.hibernate.dialect.function.CastFunction'. But in NHibernate 2.0 we have only 'NHibernate.Dialect.Function.CastFunction' and no ConvertFunction. The same situation is in NHibernate 2.1.

Why is it missing? Can I use some workarounds to get the same result?

Thanks,
Bogdan


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.