TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Umesh
NA
1
0
Date problem in sql server 2005
May 12 2007 4:06 AM
Hi!
I am using SQL Server 2005 express edition as backend and Visual Basic 2005 express edition as frontend. This question is related to date comparison.
SELECT IssueDate, Client, AgencyCode
FROM SPACEBOOKING
WHERE (IssueDate BETWEEN CONVERT(DATETIME, '2006-05-01 00:00:00', 102) AND CONVERT(DATETIME, '2006-05-31 00:00:00', 102)) AND (AgencyCode = 1595)
ORDER BY IssueDate
Above query is generated by query designer and it retrieves 16 records.
However, when I use this code in my vb 2005 application and instead of '2006-05-01 00:00:00', I use dtpicker1.value and instead of '2006-05-31 00:00:00' I use dtpicker2.value, it gives me the following error :
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
What is the problem and how to solve it?
My regional date setting id dd/mm/yyyy.
Reply
Answers (
1
)
How to pass parameter from aspx page to report
Relationships and views in SQL Server Compact Edition