will the VB ISDate and DateDiff functions work in ASP??

Results 1 to 2 of 2

Thread: will the VB ISDate and DateDiff functions work in ASP??

  1. #1
    Join Date
    Dec 1969
    Posts
    6

    Default will the VB ISDate and DateDiff functions work in ASP??

    I am trying to get the ISDate and DateDiff function to work and am having no luck. I want the ISDate to check the input from a text box and if it isn&#039t valid to return a msg box. After 2 dates are entered I want to use the DateDiff function to see if they are more than 90 days apart again with a msg box. I have tried the functions and I keep getting a runtime "object expected" at the top of the form. Any one have any ideas?

  2. #2
    Join Date
    Dec 1969
    Posts
    22

    Default RE: will the VB ISDate and DateDiff functions work in ASP??

    Hmmm they should work<BR>You might want to try doing this:<BR><BR>dim date1,date2<BR>date1 = Request.Form("date1TextBox")<BR>date2 = Request.Form("date2TextBox")<BR><BR>dim numDaysApart<BR>if IsDate( CDate(date1) ) and IsDate( CDate(date2) ) Then<BR> numDaysApart = DateDiff("d", date1, date2)<BR>end if<BR><BR>this should all be down in an asp page and it should work, hope this helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •