I want to calculate the numbers of days and nights between two dates. My date fields are in string types. I am trying to subtract like that but the sing "-" gives error. My code is like that.
(DateTime.Parse(dr["dtarihi"].ToString()).ToShortDateString()) - (DateTime.Parse(dr["dtarihi"].ToString()).ToShortDateString())
Prasad RaveendranPosted Jun 14, 2023, 2:28 AM
please try the below code
Mehmet FatihPosted Jun 14, 2023, 9:44 AM
First of all, thank you very much for your interest. The problem has been solved.