I have the code below in a agent with the below mentioned values in the varables.The 1st if statement gives the correct result(“True”).But the second statement does not work properly.I used Format,CDat,CVDate functions.They convert my variable value in to 31/12/1999 or 12:00:00.why is this happening.And why when 1 works fine does the other not.
c_Date = 2/28/05
sub16_4 = 20040909
sub16_5 = 20050909
If C_Date > sub16_4 Then
Msgbox("true 4")
End If
If C_Date <= sub16_5 Then
Msgbox("true 5")
End If
Any help will be greatly apriciated.
Thanks in advance
Malik
Subject: Developers : Why is this Happening? Pls Help
Malik,
It looks as though you are trying to compare dates but the 3 variables in your code all contain numbers. 2/28/05 is interpreted as 2 divided by 28 divided by 5. 20040909 is a number meaning 20 million, 40 thousand and 9 hundred and nine.
I could rewrite this for you but I don’t think it will do much good until you learn the basics. If you can’t get a book then there are lots of good LotusScript resources on the web and in the Designer Help. Good luck.
Subject: RE: Developers : Why is this Happening? Pls Help
Hi Tom,
Thanks for the advice.
I figured that the problem was with the data type of the values.
Thats the reason I tried formating them as well as trying to convert them into the same date format using Cdat & CvDate. But it gives totaly wrong date values like 31/12/1999 for all the values. Why is this?
Cheers,
Malik