Please help

Why would someone have a positive test one day and then a week or so later have a negative test? I just took a test tonight and it came up negative. The reason I took one cause today I had cramping on and off all day. Could it be cause it’s nighttime? Has anyone had this issue?