var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: date compare problem
i have date on web page in (dd-mon-yyyy) format
and in database i m storing it as text
Now i want to compare two dates cud u help out....
feel free to mail on firstname.lastname@example.org
I think there are 2 ways:
1. Convert both to text (I thing it is so?), both having the right format and to compare them as text values.
2. Convert both to dates and again to compare them as dates.
Sounds like you want option 2.
The CDate function in VBScript is your friend in this case. It should work with the format you have.
Why are you storing them as text in the database.
Oh, if you want to do the comparison in at the database (rather then in the asp page) let us know what database you are using and we should be able to come up with something.
wat is way.....
Wat is the way to use that 'CDate' function and how to compare two dates.......... cud u plz show me some sort of code for dat.... ...
something like this....
You also might want to check out the DateDiff function.... have a search on
date1 = "01-Jan-2005"
date2 = "03-Jan-2005"
if(CDate(date1) > CDate(date2)) then
' do some stuff
' do some other stuff
http://msdn.microsoft.com/library/ for more details