r3nder
asked on
putting PM in a DateTime format in a winform
I have a sql statement that I am trying to put a start date and an end date into. The startdate is DateTime.Today - because that returns MM/dd/yyyy 12:00:00 AM
I need the end date to be MM/dd/yyyy 11:59:59 PM - How is this done? When I use tt it returns AM
I would appreciate the help
Thanks R3nder
I need the end date to be MM/dd/yyyy 11:59:59 PM - How is this done? When I use tt it returns AM
private void radButton1_Click(object sender, EventArgs e)
{
DateTime tempend = DateTime.Today;
string format = "MM/dd/yyy 11:59:59 tt";
string end = tempend.ToString(format);
DateTime start = DateTime.Today;
string newuserid = iuserid.ToString();
string conString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
string sqlstr = "delete from ARoles where useruid ='" + newuserid + "' and LastEditDate between '" + start + "' and '" + end + "'";
HelperClasses.SqlHelper.ExecuteNonQuery(conString, CommandType.Text, sqlstr);
this.Close();
}
I would appreciate the help
Thanks R3nder
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER