CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Conditional Date Format

Print topic Send  topic

Author Message
Sean
Posted: 11/18/2003, 9:29 AM

I am using ASP w/templates, Access 2000 and CCS 2.2.

Is there a way to put a condition in a date field (label) to display in red if the condition is met?

Ex. I have a warranty expiration date column. Once the warranty expiration is reached, I would like it to display in red.

I found how to do this with numbers, but not with dates.

Thanks.
Rian
Posted: 11/19/2003, 9:35 PM

Hi Sean,

I am trying to accomplish exactly the same thing in a project I am working on. Did you find a solution for this yet?
Maybe you can post the method you got to work for numbers?

Thanks!
Rian
ryan
Posted: 11/19/2003, 10:05 PM

I presume that's a grid on the before show row event of your grid try the ff:

dim EvalDate,expireday_,expireday3months_, disp_

EvalDate = CDate(yourformname.warrantyexpirationdatecolumn.value)

expireday_ = CDate(Date())
'I assume to make it expire in 3 months starting this day
expireday3months_ = CDate(DateAdd("m", 3, Date()))

IF (EvalDate>=MINDateByIP AND EvalDate<=expireday3months_) THEN
'do nothing
ELSE
disp_ = "<font color=red>" & _
yourformname.warrantyexpirationdatecolumn.value & _
"</font>"
END IF

Then set the content of that label to HTML instead of text I hope this helps

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.