Solved

problem with date before other date (if  ....)

Posted on 2012-04-03
2
232 Views
Last Modified: 2012-04-03
i want to compare two dates, but it doesn't work, can anyone help me?

thx


<%
            date_pivot = "16/03/" & year(now)
            
            if date() < date_pivot then%>
            <%=date()+30%>
            <% else%>
            <%=date()+7%>
            <% end if%>
%>
0
Comment
Question by:fedkris
2 Comments
 
LVL 17

Accepted Solution

by:
sonawanekiran earned 500 total points
ID: 37800300
Have you tried like this.....

If DateDiff("d", Date1, Date2) > 1
  'Date1 is before Date2
Else
  '  'Date1 is after Date2
End If
0
 

Author Closing Comment

by:fedkris
ID: 37800937
it works for me, thx
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question