DateAdd function in Frontpage

W

Wayne-I-M

Hi

I would like to have a text box on a form (asp) showing something like
"Must be after February 2010"
This would be for forms shown during 2009.
So the date (year) would be this year +1

Is this possible in frontpage?

Sort of the same as the access function DateAdd
="Must be after "&Format(DateAdd("Y", 1, Date()),"mmm yyyy"
I know this will not work in frontpage, just an example
 
S

Stefan B Rusynko

If you always want 1 year from the current date
- In a .asp page it would be
<%
NewDate=DateAdd("Y", 1, Date())
DateText="Must be after " & MonthName(Month(NewDate)) & " " Year(NewDate)
Response.Write DateText
%>
See the VBscript references DateAdd, MonthName,Month, and Year at:
http://www.devguru.com/technologies/vbscript/quickref/vbscript_list.html

Or, since you don't care about the day, you could just do
<% = "Must be after " & MonthName(Month(Date()) & " " Year(Date())+1 %>




_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


Hi

I would like to have a text box on a form (asp) showing something like
"Must be after February 2010"
This would be for forms shown during 2009.
So the date (year) would be this year +1

Is this possible in frontpage?

Sort of the same as the access function DateAdd
="Must be after "&Format(DateAdd("Y", 1, Date()),"mmm yyyy"
I know this will not work in frontpage, just an example
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top