date comparision

select * from tablename where joiningdate between '01/05/07' and'30/05/07' notworking . my database is sqlserver. only date part is compared but not the month or year. plaese help me.
[194 byte] By [sushanta_dash@.a] at [2007-11-27 4:46:38]
# 1
try to do a "order by <the date field>", it should sort the date column
JWKC-5ivea at 2007-7-12 9:59:12 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
Hii have tried "select * from tablename where joiningdate between '01/05/07' and '30/05/07' orderby joiningdate" . The result is data which are of other month and year also this month and year. the date part is only compared. please helpme.
sushanta_dash@.a at 2007-7-12 9:59:12 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
HI,can u try this outselect * from tablename where joindate between '05/01/07' and '05/30/07' All the best
hetal_giria at 2007-7-12 9:59:12 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4
http://www.thescripts.com/forum/thread595836.htmlhave a look at this post.. see if this help...
JWKC-5ivea at 2007-7-12 9:59:12 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5
try this:String sql = "SELECT * FROM DATE_SAMPLE WHERE SAMPLE_DATE >= '2007-05-01' AND SAMPLE_DATE <'2007-05-30'";Hope That Helps
java_2006a at 2007-7-12 9:59:12 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...