Problem with Date-Comparison - Curdate()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • murugavelmsc
    New Member
    • Apr 2008
    • 54

    #1

    Problem with Date-Comparison - Curdate()

    Hi i write a javascript code, it throws an error

    [CODE=javascript]tod=new Date()
    if(row["birthdate"]=tod.getDate())
    {"/webcontent/birt/images/birthdaycake2.j pg"}
    else
    {"/webcontent/birt/images/bxp37686.jpg"}[/CODE]

    Thanks,
    Murugavel
    Last edited by gits; Nov 7 '08, 01:06 PM. Reason: added code tags
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    you do an assignment here:

    Code:
    if(row["birthdate"]=tod.getDate())
    instead of a comparation:

    Code:
    if(row["birthdate"] == tod.getDate())
    kind regards

    PS: and just defining different strings for the cases does nothing. what should be done with it? changing an image-src?

    PPS: i just changed the thread-title to better describe the problem and so that users with similar problems may have a chance to find the thread - please always use a meaningful thread-title according to the posting guidelines.

    Comment

    Working...