Between two Date Range

Jun 14 2018 1:46 AM
Hi all
 
my sql select query 
 
SELECT count(mrcpsession),mrcpsession,mrcptime,mrcpclient FROM ibot.mrcp where mrcptime between '2018-06-13 01:00:00' and '2018-06-13 02:00:00' group by mrcpsession;
 
when i run sql query out coming between date.
 
I need to know how we can select the data range with time frame i hours between two dates
MySqlCommand cmd = new MySqlCommand("select count(mrcpsession),mrcpsession, mrcptime, mrcpclient ibot.mrcp where mrcptime between @mrcptime1 and @mrcptime2 group by mrcpsession;", con);
cmd.Parameters.AddWithValue("@mrcptime1", First_date);
cmd.Parameters.AddWithValue("@mrcptime2", Secoundate);
DataSet dst = new DataSet();
MySqlDataAdapter dtr = new MySqlDataAdapter(cmd);
dtr.Fill(dst);
Console.WriteLine(dst);
Console.Read();
can you suggest code please i need to show console application when select data range
 
i should show console application when data range give 

Answers (1)