CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 Insert date in future depending on priority

Print topic Send  topic

Author Message
grivers

Posts: 28
Posted: 12/10/2008, 3:32 AM

I have a date due field that needs to be populated when a record is created or updated depening on the priority of the record. Priority text chioces are low, medium and high.
I would like the due date to be automatically entered depending on the chioce made for the priority. e.g.
Priority = low, due date is eqaul to today + 60 days

I thought I would be able to do this using code similar to below but have not got it working yet. It keeps saying expected end.

If (enquiry.priority.Text = "Low") then enquiry.TextBox1.Text = Date()+60
Else If (enquiry.priority.Text = "Medium") then enquiry.TextBox1.Text = Date()+120
View profile  Send private message
JimmyCrackedCorn

Posts: 583
Posted: 12/10/2008, 6:08 AM

try this,

If (enquiry.priority.Text = "Low") then enquiry.TextBox1.Text = DateAdd("d",60,Date())
Else If (enquiry.priority.Text = "Medium") then enquiry.TextBox1.Text = DateAdd("d",120,Date())

_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
JimmyCrackedCorn

Posts: 583
Posted: 12/11/2008, 10:32 AM

did this work?
_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
grivers

Posts: 28
Posted: 12/12/2008, 12:45 AM

Yes, this worked thank you very much. Couldn't log in the other day to say thanks.
View profile  Send private message
JimmyCrackedCorn

Posts: 583
Posted: 12/12/2008, 8:04 AM

excellent! here is a great vbscript resource I use all the time,

http://www.w3schools.com/Vbscript/default.asp

I don't even try and remember syntax, functions or anything any more; I just jump to that site and look it up!!


oh and be sure to add [RESOLVED] or [SOLVED] to your forum title. 8-)
_________________
Walter Kempees...you are dearly missed.
View profile  Send private message

Add new topic Subscribe to topic   


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

Web Database

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.