Click here to Skip to main content
15,799,398 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Good Morning.
I made a view with select in SQL.
I need the negative numbers to be in green color, and the positive ones in red when I run the view.
It's possible?

What I have tried:

I tried several suggestions that I searched on the net but so far I haven't found anything
Updated 22-Jul-22 0:05am
RickZeeland 22-Jul-22 5:02am    
Are you using SQL Server or another database?

It's going to depend on the environment in which your code runs, the presentation language(s) you are using, and the framework under which that operates.

For C# and WinForms, this may help: Colouring DataGridView Cells According to their Content in WinForms[^]

Probably, a similar technique is applicable for other systems, but without much better data we really can't be specific!
Share this answer
You can't do that with clear SQL! You have to use reporting tools, ie.: Crystal Reports. See: Formatting Crystal Reports based on the values present in the Crystal Report | SAP Community[^]
Share this answer
Maybe you can use ElectroCRUD, see: database-clients[^]
If the feature you want is not supported, you can modify the source code as this is an open-source project.
It does not seem to support SQL Server however.

If you are willing to do some Delphi programming, HeidiSQL might be another option: GitHub - HeidiSQL/HeidiSQL: A lightweight client for managing MariaDB, MySQL, SQL Server, PostgreSQL and SQLite, written in Delphi[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900