Condition with Date

del_toro02del_toro02 Member Posts: 19
I would like to make a condition with a date like this :

if date=31.01.08 then

but it is "date=text". Could you please help me and give me the correct format ?

Answers

  • AlkroAlkro Member Posts: 115
    IF Date = 31018D THEN

    Another choice is compare with Day Month or Year. Like this:
    DATE2DMY(Date,1) --> Day
    DATE2DMY(Date,2) --> Month
    DATE2DMY(Date,3) --> Year
  • del_toro02del_toro02 Member Posts: 19
    when I try IF Date = 31018D THEN, I get the error msg "There is an error in a constant" :(
  • garakgarak Member Posts: 3,263
    del_toro02 wrote:
    when I try IF Date = 31018D THEN, I get the error msg "There is an error in a constant" :(

    use following:
    if (MyDateVar = 310108D) then;
    

    The problem in your source is the incorrect DateFormat.

    Regards
    Do you make it right, it works too!
  • del_toro02del_toro02 Member Posts: 19
    it's working, thanks !
  • AlkroAlkro Member Posts: 115
    del_toro02 wrote:
    when I try IF Date = 31018D THEN, I get the error msg "There is an error in a constant" :(
    Sorry for my mistake.

    310108D

    :)
Sign In or Register to comment.