Compare two columns with search

QuestionsCompare two columns with search
Mike Sheppard asked 9 years ago

I have reviewed the demos and read-through the help – but I can't really find a direct answer.

How can I search based on one-column (say Qty On Hand) versus another column (say Qty on Order)?

I would like to search:

Qty_on_Hand (Column 1) is greater than Qty_on_Order (Column 2)?

Or simply COLUMN1 > COLUMN2

Thanks for any assistance.

Mike

4 Answers
Abu Ghufran answered 9 years ago

Hello,

This is currently not supported.

I guess using 3rd column (boolean type) that will hold the comparison result is alternate option.
One can perform search on that 3rd column for 1/0.

Mike Sheppard answered 9 years ago

Does anyone have any feedback on this? I am finding a number of reports now that need to be able to create a filter if a value in Column 1 is > or = to a Value in Column 2.

Hopefully someone has some guidance (other than creating another column in SQL to do the comparison – as that doesn't always solve the issue).

Thanks

Mike

Mike Sheppard answered 9 years ago

For anyone else with this same issue – I solved the problem by including a form above the PHP Grid output with check-boxes.

Each check-box was a complex where-clause that I added as a $_GET variable to the top of the PHPGrid page.

When checked – it applies the variable as a WHERE clause on the SQL which limits the results to search-by. It will work for our needs very well.

Thanks

Mike

Abu Ghufran answered 9 years ago

Thanks for sharing

Your Answer

3 + 7 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?