Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 creating table with a date field

Author  Topic 

jtwork
Yak Posting Veteran

82 Posts

Posted - 2007-02-21 : 14:37:46
well i guess we were all a newb once so here goes

something is wrong with the below it just doesnt like the date part

create table PLN_Workgroup_Resource
(
Dte date(ddmmyyyy),
Workgroup varchar(20),
AM_Hrs integer(3),
PM_Hrs integer(3),
EVE_Hrs integer(3)
)
;

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-02-21 : 14:41:10
This sure doesn't look like SQL Server.

Here's the code for this table if your dbms is SQL Server:

create table PLN_Workgroup_Resource
(
Dte datetime,
Workgroup varchar(20),
AM_Hrs int,
PM_Hrs int,
EVE_Hrs int
)

Tara Kizer
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-02-21 : 14:41:11
How do you know "something is wrong"? Do you get an error message? What does it say? Most of that syntax is not valid for T-SQL ... are you using Microsoft SQL Server?



- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

jtwork
Yak Posting Veteran

82 Posts

Posted - 2007-02-21 : 14:50:30
sorry im only just getting up and running. Im using query analyzer, maybe you know of a good forum as ive not found one just yet?

Im getting the following error

Server: Msg 2715, Level 16, State 7, Line 1
Column or parameter #1: Cannot find data type date.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-02-21 : 14:59:25
Query Analyzer is SQL Server, so this is the forum to use. Wejust weren't sure if you were using SQL Server due to the data types you were using in your first post.

If you are running the command in your first post, then you'll definitely get errors. Check out the code that I posted.

Tara Kizer
Go to Top of Page
   

- Advertisement -