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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 datetime problem
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bilencekic
Posting Yak Master

121 Posts

Posted - 12/17/2005 :  08:12:22  Show Profile  Visit bilencekic's Homepage  Reply with Quote
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)

Singapore
17689 Posts

Posted - 12/17/2005 :  08:35:36  Show Profile  Reply with Quote
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 - 12/17/2005 :  08:43:23  Show Profile  Visit bilencekic's Homepage  Reply with Quote
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)

Singapore
17689 Posts

Posted - 12/17/2005 :  08:46:36  Show Profile  Reply with Quote
Good to hear that

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

Learn something new everyday

Edited by - khtan on 12/17/2005 18:53:44
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000