Link to home
Create AccountLog in
Avatar of Dinesh Kumar
Dinesh KumarFlag for India

asked on

sql Dates

I have two queries:

1) select * from tblName where convert(varchar(50),transactionDate,101) BETWEEN '12/29/2010' and '01/01/2011'

2) select * from tblName where convert(varchar(50),transactionDate,101) BETWEEN '12/29/2010' and '12/29/2010'

But first one query is not giving results while the second one gives results.

The storage of transactionDate(DataType is  datetime)  in table is like the following:
2011-01-03 14:12:13.920
2010-12-27 12:51:55.840

Note: The records exists in the table related with first query.

if you can provide the reason and the solution as well.

Waiting..


SOLUTION
Avatar of Alpesh Patel
Alpesh Patel
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Dinesh Kumar

ASKER

Thank you all.