Hi
I have datetime field Order_Date in MYSQl table (2008-11-11 13:23:44.657)
I have 1 variable in which date is stored in dd-MM-yyyy format
I want to write a sql statement (select * from table1 where order_date = variable . How i write this statement comparing the dates . I am using MySql.
Thanks
Loading
Jagjit SainiPosted Sep 5, 2011, 7:23 AM
i have done this & it's working
Select count(*) from hs_hr_attendance where convert(order_time,DATE) = '" + _dt.ToString("yyyy-MM-dd")
Thanks
Prabhu RajaPosted Sep 5, 2011, 7:06 AM
Select count(*) from table where LEFT(CONVERT(datetime, order_date , 120), 10) = yourvariable;
-----------------------------------
if this post helps you. Mark this as "Correct answer"