Click here to Skip to main content
15,889,367 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to give red background to column in select statement if it less than 50 and green if it bigger than that

What I have tried:

I tried use '
' + CN + '
'

notice type CN is numeric
Posted
Updated 11-Jul-19 10:55am
Comments
Member 14160360 5-Jul-19 17:11pm    
I wrote in what i have tried section dir because this happens this mistake
MadMyche 5-Jul-19 17:25pm    
In what application? MS Access, Sql Studio, Crystal reports???
Member 14160360 5-Jul-19 17:27pm    
ms access 2007
MadMyche 6-Jul-19 8:17am    
OK, is this when looking at the table, a view, a form, or a report?

It sounds like you want to use Conditional Formatting, just like Excel.

What you need to understand about Access is that there are 2 different groups of Access Object types; the SQL database objects and the User Interfaces.
The SQL objects are called Tables and Queries. These are just for data and really are not intended for regular direct user access.
The User Interface objects are Forms and Reports. As these are intended for the end users use, they are customizable either via design, code, or macros; and does have Conditional Formatting available.

Now if your intent is to change the coloring in tables or queries, it ain't happening as these are only raw data. What you can do is use a tabular form within a form which can be styled as you desire.

References:
Highlight data with conditional formatting - Access[^]
Access database - conditional formatting on a datasheet[^]
 
Share this answer
 
Comments
Maciej Los 8-Jul-19 14:31pm    
5ed!
MadMyche 8-Jul-19 14:52pm    
Thank you
If you want to display data with conditional formatting you will need to use a form or report.
You can't use conditional formatting within SQL statement!
 
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