home
training courses
why choose us?
solutions
support
company
LearnItFirst User Forum
Welcome Guest
Search
|
New Posts
|
Members
|
Log In
|
Register
SQL Server Forum - LearnItFirst.com
»
Transact-SQL Programming
»
DML (SELECT, INSERT, UPDATE, DELETE) Questions
»
Problem with comaparing exact date in WHERE part of query....
Problem with comaparing exact date in WHERE part of query....
Options
Previous Topic
·
Next Topic
mykill102
Posted:
Thursday, December 17, 2009 7:22:13 PM
Rank: Newbie
Joined: 12/17/2009
Posts: 1
Points: 3
Where do you live?: philippines
Hi...
I got a problem with comparing date on WHERE part of my query even the date is in exact format...
Table Name : cash_up
Field: date_out
date_out value: '2009-12-17 10:45:52.5900000'
Note: CAST('2009-12-17 10:45:52.5900000' as datetime) = '12/17/2009 10:45:52 AM'
My Query:
SELECT
CAST(date_out as datetime) as date_out
FROM cash_up
WHERE
CAST(date_out as datetime) = '12/17/2009 10:45:52 AM'
I got no result.....
somebody know how can i fix this.... please ...
many thanks for any reply.....
Back to top
bklr
Posted:
Monday, December 28, 2009 1:15:48 AM
Rank: PFY
Joined: 1/21/2009
Posts: 27
Points: 81
Where do you live?: India
SELECT
CAST(date_out as datetime) as date_out
FROM cash_up
WHERE
CAST(date_out as datetime) = DATEADD(d,DATEDIFF(d,0,'12/17/2009 10:45:52 AM'),0)
Back to top
Users browsing this topic
Guest
Forum Jump
SQL Server Database Administration
- General SQL Database Question & Answer
- Backup, Recovery and Disaster Recovery
- SQL Server Security
- Integration Services (SSIS) and DTS
Transact-SQL Programming
- DML (SELECT, INSERT, UPDATE, DELETE) Questions
- Stored Procedures, Triggers, & Functions
SQL Server Scripts, Code Samples and SSMS Custom Reports
- All SQL Server Versions
- SQL Server 2005/2008
- SQL Server Management Studio Custom Reports
Customer Service
- Video Requests
You
cannot
post new topics in this forum.
You
cannot
reply to topics in this forum.
You
cannot
delete your posts in this forum.
You
cannot
edit your posts in this forum.
You
cannot
create polls in this forum.
You
cannot
vote in polls in this forum.
SQL Server 2005 DBA Training Videos
SQL Server 2008 DBA Training Videos
Email this topic
RSS Feed
Watch this topic
Print this topic
Normal
Threaded