-->
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: Criteria group by property with substr
PostPosted: Wed Nov 13, 2013 12:01 am 
Newbie

Joined: Mon Jul 06, 2009 9:34 am
Posts: 3
Hi,

I have a column with data as "YYYYMMDD" - "20130101" and I am trying to use Criteria to group by this column.

But I should group by year alone, which is substring of the column.

I am able to achieve this using
Projections.sqlGroupProjection(substr(SERVICE_PERIOD,1,4) -- Here SERVICE_PERIOD column holds data like 20130101 and my query should group by this column by year alone.

Please let me know is there any other better way to achieve this without using sqlGroupProjection.

Thanks.
Ram Mohan.

_________________
Thanks,
Ram Mohan


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.