Results 1 to 3 of 3

Thread: this makes no logical sense

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    10

    Angry

    Code:
    Do
    	if DateDiff("d",Date(),objRS("start_date")) >= 0 then
    		if DateDiff("d",Date(),objRS("start_date")) = 0 then
    		Response.Write("TODAY")
    		else if DateDiff("d",Date(),objRS("start_date")) <= 5 then
    		Response.Write("SOON")
    		if DateDiff("d",Date(),objRS("start_date")) > 5 then
    		Response.Write("GOT A WHILE")
    		end if
    	end if
    	objRS.MoveNext
    Loop While objRS.EOF
    it seems that the if statement is killing my loop, no matter what kind of loop i do, it dies and errors.
    can someone explain to me why?
    ***SPLAT***
    Road-Kill on the
    information super-highway

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    try this:

    Code:
    Do until objRS.EOF
        if DateDiff("d",Date(),CDate(objRS("start_date"))) >= 0 then
    	if DateDiff("d",Date(),CDate(objRS("start_date"))) = 0 then
    	    Response.Write("TODAY")
    	ElseIf DateDiff("d",Date(),CDate(objRS("start_date"))) <= 5 then
    	    Response.Write("SOON")
    	ElseIf DateDiff("d",Date(),CDate(objRS("start_date"))) > 5 then
    	    Response.Write("GOT A WHILE")
    	End If
    
        End If
    
        objRS.MoveNext
    Loop
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    10

    Angry

    yea, after an hour of beating myself in the face i realized my mistake... i hate it when its something simple like that, i wanted to die.
    ***SPLAT***
    Road-Kill on the
    information super-highway

Posting Permissions

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



Click Here to Expand Forum to Full Width