ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Sorting Issue

Post new topic  Reply to topic
 Sorting Issue « View previous topic :: View next topic » 
Author Message
firoj.badsa
PostPosted: Tue Jul 06, 2010 5:49 am    Post subject: Sorting Issue Reply with quote

Centurion

Joined: 16 Feb 2007
Posts: 104

Hi,

I have an input xml. I have to sort according to a particular element. Here
LaborRateStartDate.

<ListOfPriceList2>
<PriceList2>
<LaborRate>79.99</LaborRate>
<LaborRateStartDate>04/30/2010 17:00:00</LaborRateStartDate>
<LaborRateEndDate>05/31/2010 17:00:00</LaborRateEndDate>
<NAVAMLaborRateCreated>07/06/2009 11:45:28</NAVAMLaborRateCreated>
<NAVAMLaborRateLastUpdated>07/06/2009 11:45:28</NAVAMLaborRateLastUpdated>
</PriceList2>
<PriceList2>
<LaborRate>89.99</LaborRate>
<LaborRateStartDate>05/31/2010 17:00:00</LaborRateStartDate>
<LaborRateEndDate>06/30/2010 17:00:00</LaborRateEndDate>
<NAVAMLaborRateCreated>07/06/2009 11:40:58</NAVAMLaborRateCreated>
<NAVAMLaborRateLastUpdated>07/06/2009 11:40:58</NAVAMLaborRateLastUpdated>
</PriceList2>
<PriceList2>
<LaborRate>99.99</LaborRate>
<LaborRateStartDate>06/30/2010 17:00:00</LaborRateStartDate>
<LaborRateEndDate>07/31/2010 17:00:00</LaborRateEndDate>
<NAVAMLaborRateCreated>07/01/2009 11:58:16</NAVAMLaborRateCreated>
<NAVAMLaborRateLastUpdated>07/06/2009 11:39:25</NAVAMLaborRateLastUpdated>
</PriceList2>
</ListOfPriceList2>

Can anyone please guide me to sort the PriceList2 according to the LaborRateStartDate.
I was trying to get the difference from the CURRENT_DATE for all the fields.not sure how to proceed from there.
thanks in advance.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jul 06, 2010 5:59 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I was trying to get the difference from the CURRENT_DATE for all the fields
I would do it differently. You need to convert the string from the XML into an ESQL TIMESTAMP ( easy enough using CAST with a FORMAT clause, I think ). Then you can implement one of the standard sort algorithms using the simple comparison operators >, <, =.
Back to top
View user's profile Send private message
firoj.badsa
PostPosted: Tue Jul 06, 2010 9:57 pm    Post subject: Reply with quote

Centurion

Joined: 16 Feb 2007
Posts: 104

Thanks! that was a good advice. done now.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Sorting Issue
Jump to:  



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
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.