You showed no block images so any advice is a guess Mariam.
The following advice might help you solve your issue:
Have you done any basic debugging; like perhaps DoIt ? (explained here
) so you can see what is being stored?
Get a List of all the Tags stored using the call TinyDB.GetTags block with a Label.... perhaps Label1.text = call TinyDB.GetTags will show you what tags are actually being stored. You can compare that with what you think is being stored. Be careful when calling for a specific tag. App Inventor, for many activities, is case sensitive a tag called mytag is not the same as Mytag or MyTag.
The error you get might be 'runtime' error. I don't know. If it is a runtime error, what might be happening is what you choose in the datapicker is not fully resolving the date information before your following code executes. This can easily happen if you are picking the date on one screen and expecting to use it on a second screen without correctly passing the values. A reason I seldom code on more than one screen; doing so causes complications that have to be coded around.
No one has seen your actual blocks except you so no one really knows what the issue might be.
Regards,
Steve