sir
in our server date format is mm-dd-yyyy
in local machine date format is mm/dd/yyyy
in my asp.net program
- DateTime FrDate, Todate;
- string yy = "2020";
- string mm = "04";
- string dd = "01";
- DateTime.TryParse(mm + "/" + dd + "/" + yy, out FrDate);
and query
select * from helpdesk_tranactions where compl_date = '" + FrDate.ToShortDateString() + "' is working fine in local machine where date is mm/dd/yyyy
when deployed to server same query not working (date format is mm-dd-yyyy) error is
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
The statement has been terminated.
can you please help me with this query should work irrespective of system date.
Regards
Lakshmi