NatuScape
02-06-2003, 01:54 PM
Hi all!
I'm trying to use some code to format a date field from a database in red background when it's older than today. This bit of code I put together works wonderfully when the field has data, but not so when the field is null. I can't get it to work and I'm sure it's a silly thing I'm missing... Help!?
CODE:
date1 = Date()
date2 = FP_FieldVal(fp_rs,"DueDate")
Ldate2 = Len(date2)
If Len(date2) = 0 then
Response.Write("")
Else
If DateDiff("d", date1, date2) < 0 then
Response.Write("bgcolor=#CC0000")
Else
Response.Write("")
End If
End If
Thanks a bunch!
Natalia
I'm trying to use some code to format a date field from a database in red background when it's older than today. This bit of code I put together works wonderfully when the field has data, but not so when the field is null. I can't get it to work and I'm sure it's a silly thing I'm missing... Help!?
CODE:
date1 = Date()
date2 = FP_FieldVal(fp_rs,"DueDate")
Ldate2 = Len(date2)
If Len(date2) = 0 then
Response.Write("")
Else
If DateDiff("d", date1, date2) < 0 then
Response.Write("bgcolor=#CC0000")
Else
Response.Write("")
End If
End If
Thanks a bunch!
Natalia