I would like to compare dates in MS ACCESS
SELECT *
FROM Ledger
WHERE TranDate>1/1/2008 TranDate<1/1/2009
ORDER BY TranDate;
But when I use the above it gives no results where as there are lots of records for 2008 and when I use quotes it gives error saying datatype mismatch
|
~ Б0ЯИ Τ0 С0δЭ ~
|
![]() |
| 2Jun2009,17:12 | #2 |
|
I think this should work :
Code: SQL
Last edited by SaswatPadhi; 2Jun2009 at 17:15.. |
|
Go4Expert Member
|
|
| 2Jun2009,17:22 | #3 |
|
U Haven't used "and" keyword to join both conditions..use it like this..
SELECT * FROM Ledger WHERE TranDate>1/1/2008 andTranDate<1/1/2009 ORDER BY TranDate; And Also be Sure that TranDate is Text dataType ...... |
|
Go4Expert Member
|
|
| 2Jun2009,17:24 | #4 |
|
U Haven't used "and" keyword to join both conditions..use it like this..
SELECT * FROM Ledger WHERE TranDate>#1/1/2008# andTranDate<#1/1/2009# ORDER BY TranDate; # delimitter must used in ms access |
|
~ Б0ЯИ Τ0 С0δЭ ~
|
![]() |
| 2Jun2009,17:27 | #5 |
|
Quote:
Originally Posted by sriram225 TranDate is obviously Date data-type. Sriram, don't be hurried to post. Take your time and include all you want to say in one post. Last edited by SaswatPadhi; 2Jun2009 at 17:32.. |
|
Go4Expert Member
|
|
| 2Jun2009,21:08 | #6 |
|
Dude Here also same problem............cool KID
|
|
Go4Expert Member
|
|
| 2Jun2009,21:12 | #7 |
|
Quote:
|


