the 4 times they didn't
after the events in fire and water, sam was so damn happy that he was still alive that after he was released from the infirmary, she went to his apartment. sam hugged him for the longest time, maybe too long. there was a moment where it seemed like he was going to kiss her, but the phone rang & disrupted the moment. sam left soon after.
in the alternate time line of moebius alt-daniel got an ego boost after being asked to the cheyenne mountain complex & all they were told. he went to alt-sam's room their first night there. they were sitting on her bed talking when he made his move. he put his hand on her knee and leaned in to kiss her, but she turned the wrong way and they bumped noses. he tried again & got the same result. by that time she was giggling so hard that he just left in defeat.
after janet died they both needed some comfort. daniel went to sam's quarters in the SGC to talk. they both cried for a long time, then he held her for a longer time. daniel was rubbing her back in a soothing way & it seemed like sam was about to kiss him, but someone knocked on the door and disrupted the moment. daniel left soon after.
once not long after sg-1 was formed, daniel had a high fever. sam went to visit him late at night. she wiped his forehead with a cool, wet cloth. in his delirium he thought that sam was sha're & started kissing her. he ran is hands under her shirt and sam pulled away. it was difficult, but she couldn't take advantage of the situation.
the 1 time they did
after jack put himself in stasis in antarctica, daniel went to sam's apartment. they talked about atlantis & what it could mean to find it. they had a couple beers and talked some more. somehow they ended up kissing. they took off their clothes on the way to the bedroom. in the morning they woke up a bit hungover and a little confused. neither mentioned it ever again.