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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 datetime problem

Author  Topic 

bilencekic
Posting Yak Master

121 Posts

Posted - 2005-12-17 : 08:12:22
i have a column typed datetime
i will use that section for registration.
on varchar type year is inserted correctly like 01.03.1999
but when taht column is datetime the year section which is 1999 here is always inserted as 2001
why that?
on code section it must enter like 01.03.1999 but it enters like 01.03.1999
year and month is always true but year is always inserted as 2001
on datetime it enters 2001 but on varchar there is no problem
why that peoblem occured on datetime?

MS BLESS US

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2005-12-17 : 08:35:36
post your table structure, code and sample data

-----------------
[KH]

Learn something new everyday
Go to Top of Page

bilencekic
Posting Yak Master

121 Posts

Posted - 2005-12-17 : 08:43:23
CREATE TABLE [dbo].[Oyuncular] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[KullaniciAdi] [varchar] (50) COLLATE Turkish_CI_AS NULL ,
[Sifre] [varchar] (50) COLLATE Turkish_CI_AS NULL ,
[Adi] [varchar] (50) COLLATE Turkish_CI_AS NULL ,
[Soyadi] [varchar] (50) COLLATE Turkish_CI_AS NULL ,
[Cinsiyet] [char] (1) COLLATE Turkish_CI_AS NULL ,
[Email] [varchar] (50) COLLATE Turkish_CI_AS NULL ,
[DogumTarihi] [datetime] (8) COLLATE Turkish_CI_AS NULL , <<<<<<<<<<<<< this column
[OnayKodu] [varchar] (100) COLLATE Turkish_CI_AS NULL ,
[Onay] [char] (1) COLLATE Turkish_CI_AS NULL ,
[Durum] [char] (1) COLLATE Turkish_CI_AS NULL ,
[GirisTarihi] [datetime] NULL ,
[SonZiyaretTarihi] [datetime] NULL ,
[YiyecekGeliri] [smallint] NULL ,
[OdunGeliri] [int] NULL ,
[DemirGeliri] [int] NULL ,
[Krallik] [char] (2) COLLATE Turkish_CI_AS NULL ,
[IPAdres] [varchar] (50) COLLATE Turkish_CI_AS NULL
) ON [PRIMARY]
GO

-----

on .net 2003 section
code is like this
(there is a function and that is the paramater for this column)
ddl = drop down list
Me.ddldays.SelectedItem.Text & "." & Me.ddlmonths.SelectedValue & "." & Me.ddlyears.SelectedValue


wtih response.write (me.ddlyears.selectedvalue) i get the true result but it instert 1925 as 2001 and all dates as 2001.



edit: i fixed problem
on stored procecdure i set the format as char(8) but i dont think that is a reson for "2001".
but i fixed :D
thx
when i was trring to send what you want i saw my fault.
ehe thx



MS BLESS US
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2005-12-17 : 08:46:36
Good to hear that

-----------------
[KH]

Learn something new everyday
Go to Top of Page
   

- Advertisement -