-
Apr 10th, 2006, 10:38 PM
#1
Thread Starter
PowerPoster
Date only? [Resolved]
Hi.
in SQL, I have made a table which has a datetime field. This field will only store the DATE, not including time.
Now, since there is an entry of a given date, say 16/04/2006. If I execute a query to get me a record which has the date of 16/04/2006 it will not return it, as the datetime also includes time - which would be 00.00.000 and so on.
how can I just do a search based on the date given only and forget the time altogether?
I have also just tried smalldatetime but i still get no results
Last edited by Techno; Apr 10th, 2006 at 10:51 PM.
-
Apr 10th, 2006, 10:51 PM
#2
Thread Starter
PowerPoster
Re: Date only?
Sorted:
parameter should be:
'year/month/day'
ie:
DECLARE @theDate smalldatetime
SET @theDate = '2006/04/16'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|