<% @LANGUAGE = VBScript %> <% Option Explicit ' Declare these variables, because I turned on Option Explicit Dim Month Dim Day Dim Year Dim Birthdate Dim DaysOld ' Grab the form fields. In my example, form submits with a Get method, so QueryString collection is used Month=Request.QueryString("month") Day=Request.QueryString("day") Year=Request.QueryString("year") ' Create a date from the birth month, day and year and ensure it is a Date subtype Birthdate = DateValue (Month & "/" & Day & "/" & Year) ' A simple call to DateDiff does the calculation. Date returns the current date. FormatNumber ' just makes the number prettier to read. DaysOld = FormatNumber(DateDiff("d", Birthdate, Date),0) %> You are <% Response.Write(DaysOld) %> days old

If you were born on <% Response.Write FormatDateTime(Birthdate,vbLongDate) %> then you are <% Response.Write(DaysOld) %> days old