I am tired of working this out myself , i cannot understand the way the sql datetime field works its really so bad to understand , its been 2 hours now.
Problem:
I have a access database and i move it to sql server 2008 r2 table (import all).
Now i have dates in sql table like;
2012-04-03 00:00:00.000
2012-04-04 00:00:00.000
2012-04-05 00:00:00.000
2012-04-04 00:00:00.000
2012-04-05 00:00:00.000
2012-04-09 00:00:00.000
2012-04-09 00:00:00.000
And the how this sql works with date i cannot even figure out wheter its yyyy/mm/dd or yyyy/dd/mm.
Because when i run this query:
Select * from Contractor_Appointments where app_date Between '02/04/2012' and '02/04/2012'
It should return all results from 2/apr/2012 instead i get :
2012-02-04 00:00:00.000
2012-02-04 00:00:00.000
2012-02-04 00:00:00.000
2012-02-04 00:00:00.000
And when i insert into the database a new record it takes the date as:
2012-02-04 00:00:00.000
And then shows up in the above query :( please help i am tired of this sql date processing. My computer date is set to 02/04/2012 .
Any suggestion:
Thank you