Home » Developer & Programmer » Forms » Order by record value (forms 9.0.1)
Order by record value [message #654548] Fri, 05 August 2016 08:01 Go to next message
redeemer
Messages: 10
Registered: August 2016
Junior Member
Hi.

I'm using formbuilder 9.0.1. I've a table TB1 with fields id, text and department (this one with values H, S and T). I have a form in which I want to show all the messages ordered by the department, but 'S' ones shown first.
How can I do it? on palette property?

Thnks

[Updated on: Fri, 05 August 2016 08:08]

Report message to a moderator

Re: Order by record value [message #654549 is a reply to message #654548] Fri, 05 August 2016 08:21 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
That is not logical.

But can be done. You want order in rows to show but the order rules are of your own. For that I think you should add an other column lets say My_Order number. And here give the order number for your department. And in the query add this column in your order by clause
Re: Order by record value [message #654550 is a reply to message #654549] Fri, 05 August 2016 08:25 Go to previous messageGo to next message
redeemer
Messages: 10
Registered: August 2016
Junior Member
'S' ones have to be shown first because they are prioritary ones
Re: Order by record value [message #654558 is a reply to message #654550] Fri, 05 August 2016 13:33 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Put something like this into the ORDER BY block property:
order by decode(department, 'S', 1, 'H', 2, 'T', 3)
Re: Order by record value [message #654567 is a reply to message #654558] Sat, 06 August 2016 02:51 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Dear friend I don't think that this will help in sorting data.

Have you checked it?
Re: Order by record value [message #654600 is a reply to message #654567] Sat, 06 August 2016 10:54 Go to previous messageGo to next message
cookiemonster
Messages: 13919
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why wouldn't it work? It's the standard solution to this problem
Re: Order by record value [message #654689 is a reply to message #654558] Wed, 10 August 2016 06:18 Go to previous message
redeemer
Messages: 10
Registered: August 2016
Junior Member
Littlefoot wrote on Fri, 05 August 2016 13:33
Put something like this into the ORDER BY block property:
order by decode(department, 'S', 1, 'H', 2, 'T', 3)

it works! I tryed it few days ago and it's working perfectly.

Thanks Wink

[Updated on: Wed, 10 August 2016 06:19]

Report message to a moderator

Previous Topic: check box
Next Topic: where i past query for move deptname to textbox
Goto Forum:
  


Current Time: Tue Apr 16 16:27:55 CDT 2024