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
 Regarding Data Types?

Author  Topic 

soni321
Starting Member

8 Posts

Posted - 2011-04-21 : 16:17:14
i declare column with data type date.all other columns are int.
it shows error
Msg 206, Level 16, State 2, Line 1
Operand type clash: int is incompatible with date
can i change now date Data type to other data type which is compatible with int

Bhupinder Dhatt

reddymrk
Starting Member

6 Posts

Posted - 2011-04-21 : 16:38:18
quote:
Originally posted by soni321

i declare column with data type date.all other columns are int.
it shows error
Msg 206, Level 16, State 2, Line 1
Operand type clash: int is incompatible with date
can i change now date Data type to other data type which is compatible with int

Bhupinder Dhatt

Go to Top of Page

reddymrk
Starting Member

6 Posts

Posted - 2011-04-21 : 16:40:12
There is datatype Datatime can be used.
If you are using key words in the column it will throw error, such as date, time, name,...etc.
Avoid using reserved names as a coloumn.
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-04-21 : 16:59:08
You can convert the int to dates. I'm assuming that your ints in the "date" column look like 20090507 and not 39938?

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
   

- Advertisement -