By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,034 Members | 1,342 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,034 IT Pros & Developers. It's quick & easy.

How to compare date,month,year

P: 18

Im storing Issue date in database.
Issuedate stored as varchar.
and then compare to Passing string date('03/06/2008')

what is query to compare storing varchar date to passing string date.
its only compare date only. not compare month,year.
i want to compare date,month,year all things.

My query is
SELECT * from Tbl_Downloadaudit
WHERE UserID =36 and ProductID=190
and issuedate < '03/07/2008' and issuedate !='03/07/2008'

what is the query.Pls reply soon ....
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies

Expert 5K+
P: 8,127
since date is stored as varchar not DATE ,you can't compare the way you are trying to do using <.
Jun 27 '08 #2

Expert 2.5K+
P: 2,878
Convert everything to datetime data type.

-- CK
Jun 29 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.