If you write someone's name in the Death Note, they die. You can write the conditions of their death if they are possible and if they are not possible they die the default way (heart attack). If you could do this, it would mean you wrote his name in the Notebook and he could survive. That is impossible.
There may, however, be a way to do a conditional statement in a limited way to get information. "Bob dies of a heart attack at 12:00 PST if he cheated on Kimmy. He dies of a heart attack at 1:00 PST if he did not." It is not clear if this would work or not. You clearly can do "Bob writes L's real name on the wall and then chokes" which would have him die of a heart attack if he doesn't know. In any of the possible cases though, Bob would die and probably is dependent only on what Bob knows or observes.