1. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2004
    Rep Power

    Unhappy calendar problem

    Hey, guys.....

    I have a calendar where I want the form to refresh and requery the recordset with the new date clicked on the calendar by the users. In my T_Leave table, I have 3 fields which I think might be related in this coding: StartDate, EndDate and NOD (no. of days)......
    My ASP knowledge is very limited...I have written some code but it doesn't seem to work for me
    here is what I have tried:

      getdate = dDate
      'response.write getdate
      sql = "SELECT * FROM T_Leave "
      set rs = conntemp.execute(sql)
       do until rs.eof
    	 startdate = rs("StartDate").value
    	 NOD = rs("NOD").value
    	 newdate = startdate
    	 strdate = startdate & ", "
    	for i = 2 to NOD
    	  newdate = DateAdd("d", 1, newdate) 
    	  strdate = strdate & newdate & ", "
    	 strdate = left(strDate, Len(strDate)-2)
    	 MyArray = split(strdate, ", ")
    	 EndDate = MyArray(UBound(MyArray))
    	 StartDate = MyArray(0)
       sql = sql & "WHERE StartDate Between " & StartDate & " AND " & EndDate & ";" 
       'response.write sql
       If rs.eof then
    	   response.write "no records found"
       End If
    I know this is very messy code, and you might not know what am I trying to do.
    Could someone help me on this?
  2. #2
  3. The Laughing Moderator
    ASP Scholar (3000 - 3499 posts)

    Join Date
    Apr 2004
    Sydney, Australia
    Rep Power
    There are a couple of reasons why this code is not working, but I'd rather you told us why it wasn't working. Why? Because we don't fully understand what you are trying to achieve, and what results you want to get.

    Please provide more detail.

Similar Threads

  1. working with a MS Access calendar
    By lil_me in forum Microsoft Access Help
    Replies: 2
    Last Post: January 22nd, 2010, 07:56 PM
  2. If problem
    By Svenson in forum ASP Development
    Replies: 4
    Last Post: August 24th, 2004, 02:51 PM
  3. calendar control
    By yessir in forum Microsoft Access Help
    Replies: 2
    Last Post: May 19th, 2004, 08:21 AM
  4. conversion problem
    By marc01 in forum Microsoft Access Help
    Replies: 1
    Last Post: May 17th, 2004, 10:29 PM
  5. calendar date
    By loudmouth72 in forum ASP Development
    Replies: 0
    Last Post: February 11th, 2004, 09:57 AM

IMN logo majestic logo threadwatch logo seochat tools logo