472,950 Members | 2,304 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,950 software developers and data experts.

Date (not datetime) datatype in 2005?

For some reason, I recall having read that SQL Server 2005 would support
a datatype that represented date, but not time. (This would be useful
for storing things like birthday, where you usually don't care about the
time of day). But I've got SQL Server 2005 installed, and there's no
such datatype to be found.

Is this something that might be released in a Service Pack, or is it
just not going to happen?
Apr 19 '06 #1
3 14736
Larry Bertolini wrote:
For some reason, I recall having read that SQL Server 2005 would support
a datatype that represented date, but not time. (This would be useful
for storing things like birthday, where you usually don't care about the
time of day). But I've got SQL Server 2005 installed, and there's no
such datatype to be found.

Is this something that might be released in a Service Pack, or is it
just not going to happen?


DATE never made it to RTM. It's not in SP1 either.

Instead try:

CREATE TABLE tbl
(dt SMALLDATETIME NOT NULL CHECK
(DATEADD(DAY,DATEDIFF(DAY,0,dt),0)=dt), ...)

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/m...S,SQL.90).aspx
--

Apr 19 '06 #2
Larry Bertolini (be*********@osu.edu) writes:
For some reason, I recall having read that SQL Server 2005 would support
a datatype that represented date, but not time. (This would be useful
for storing things like birthday, where you usually don't care about the
time of day). But I've got SQL Server 2005 installed, and there's no
such datatype to be found.

Is this something that might be released in a Service Pack, or is it
just not going to happen?


I definitely hope it's going to happen, but it's not going to happen in
a service pack!

Your recollection is not incorrect. The first beta of SQL 2005 did have a
date data type (and a time data type). However, this was dropped and
that might be just as well. I bet you expect a date type to be compatible
with datetime, work just like datetime with dateadd() and the like.
Instead the date type was implemented in the CLR, and had completely
different syntax and operations, and was not very compatible with
datetime.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Apr 19 '06 #3

"Erland Sommarskog" <es****@sommarskog.se> wrote in message
news:Xn**********************@127.0.0.1...
Larry Bertolini (be*********@osu.edu) writes:
For some reason, I recall having read that SQL Server 2005 would support
a datatype that represented date, but not time. (This would be useful
for storing things like birthday, where you usually don't care about the
time of day). But I've got SQL Server 2005 installed, and there's no
such datatype to be found.

Is this something that might be released in a Service Pack, or is it
just not going to happen?
I definitely hope it's going to happen, but it's not going to happen in
a service pack!

Your recollection is not incorrect. The first beta of SQL 2005 did have a
date data type (and a time data type). However, this was dropped and
that might be just as well. I bet you expect a date type to be compatible
with datetime, work just like datetime with dateadd() and the like.
Instead the date type was implemented in the CLR, and had completely
different syntax and operations, and was not very compatible with
datetime.

Argh, and just today I was wondering about this in 2005.

Oh well.


--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx

Apr 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bruce | last post by:
I'm storing a date in SQL Server "12/31/2003". I'm mapping the field to a Date (not DateTime) element in a Dataset. I've got a bound text box on the form to that dataset. I see "12/31/2003...
3
by: Ed | last post by:
Hi there, My problem is the following: When I assign a custom formatted Date & Time to a Date variable it loses it’s formatting. Ex. 2005-06-07 15:46 now when I assign this to a variable of...
1
by: Ray Stevens | last post by:
Has Microsoft announced a release date for Visual Studio 2005?
0
by: vijayalakshmi.venkataraman | last post by:
Hello, I have a .NET client that accesses a Java webservice. Let me first say that the client stub I got generated from the wsdl was incomplete and had to make changes to it manually to make it...
2
by: cj | last post by:
Converting a vb2003 program to vb2005 and making some changes I just noticed in 2005 DateTime was not showing as an option when I type dim starttime as Then I noticed it's in the all listing...
3
by: Burdzy | last post by:
Hi, I am working on writing a .zip file class based on the PKWare Specifications, and in the .zip format, they save the modified time of the file in 2 pieces: 1. 2 bytes for the time 2. 2 bytes for...
6
by: Marcin Wiszowaty | last post by:
Hello, I am reading into a dataset through a dataadapter. All drag+drop implementation. I have a field in the db that is a datetime(8). whenever i readin this field the datagrid displays the...
4
by: loisk | last post by:
Hi, I am facing some problems using date expression as string datatype. Here's clip of my code. The (Intvdate) is string datatype in the MySQL linked table. Private Sub...
1
by: Vajrala Narendra | last post by:
Hi am working with asp.net with backend Sql2000 i want to store NULL in datetime datatype field through coding. i wrote a update statement as Update table set Date1='NULL' where ........ but...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.