Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Color options with 2 fields and time range

Status
Not open for further replies.

crvic

Technical User
Jun 11, 2013
4
US
I have a request from a supervisor to have multiple colors in a field based upon the the order status and time it was ordered. My biggest problem is how to enter the time ranges. I keep getting an error saying I need a "then" somewhere around the time field.

if {stpuw_histology_worklist.Status} = "ordered"
and {stpuw_histology_worklist.order_created_date} time (11,01,00) to (19,30,00)then crRed
if {stpuw_histology_worklist.Status} = "ordered"
and {stpuw_histology_worklist.order_created_date} time (19,31,00) to (08,00,00)then crBlue
if {stpuw_histology_worklist.Status} = "ordered"
and {stpuw_histology_worklist.order_created_date} time (08,01,00) to (11,00,00)then crGreen
else defaultattribute
 
I haven't had a chance to test this code, but try:

Code:
If 	{stpuw_histology_worklist.Status} = "ordered" and 
	Time({stpuw_histology_worklist.order_created_date}) in [Time(11,00,01) to Time(19,30,00)]
Then 	crRed
Else
If	{stpuw_histology_worklist.Status} = "ordered" and 
	Time({stpuw_histology_worklist.order_created_date}) in [Time(19,30,01) to Time(24,00,00)]
Then 	crBlue
Else
If	{stpuw_histology_worklist.Status} = "ordered" and 
	Time({stpuw_histology_worklist.order_created_date}) in [Time(00,00,01) to Time(08,00,00)]
Then 	crBlue
Else
If	{stpuw_histology_worklist.Status} = "ordered" and 
	Time({stpuw_histology_worklist.order_created_date}) in [Time(08,00,01) to Time(11,00,00)]
Then 	crGreen
Else 	defaultattribute

Cheers
Pete
 
Pete,

The code doesn't through any errors other than I needed to change (24,00,00) to (00,00,00), but the color is not changing from the basic black. I created some new orders this morning. The end users will use the colors to prioritize their work. I have a concern about orders from yesterday being picked up correctly.

Victor
 
Not sure why everything is showing in basic black - it works in my testing,

Where are you putting the code?


Pete
 
Pete,

I right click on the desired field, format field, go to font tab, open X+2 for color and enter the code, save and close and refresh the data. I don't get any color at all.

Victor
 
Pete,

Thanks for the help. I discovered it is case sensitive. In the report it is "Ordered" and I had "ordered" in the code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top