Showing posts with label 1900-01-01. Show all posts
Showing posts with label 1900-01-01. Show all posts

Sunday, March 25, 2012

Date problem

Hi there !
Can anyone tell me how to convert 1900-01-01 00:00:00 into current date and current time. ?

I am just one the beginer of MSSQL and ASP. I have a table name annouce which work fine before i altered it. I added one new field named tdate whcih has datetype smalldatetime & have default value getdate().

When not provide the any value when inserting a new row, I got the error "Column name or number of supplied values does not match table definition. " which is true because the number of supplied value is 1 less then number of column. But then what does the default value meant for ?

When i provide NULL means( " ") then it automatically add the above mention date and time. ?

Can anyone put some light why it happend ? Shall, i have to put all the fields name except the new added field ? or i have to do something else.

With Thankswhen you got that error message, it was most likely because you did not specify a column list for the INSERT statement

let's say your table has five fields, and you add a sixth one

in order for the default getdate() value to work, you have to sayinsert
into annouce
( fld1, fld2, fld3, fld4, fld5 )
values
( 1, 2, 3, 4, 5 )this way the number of supplied values equals the number of columns you are inserting into

the column you did not mention in the insert statement is then given its default value

rudy
http://r937.com/sql

Friday, February 24, 2012

Date Display

I have a table in SQL Server 2000 with have date/time columns and
displays the dates as : 1900-01-01 00:00:00.000 which is fine, but when
I select the column through dreamweaver for an asp page to date is
shortened to 1900-01-01 but I need to see the whole date / time field
for conversion purposes.

Can anyone help ?

Thanks in advance.Dear Gecko,

You must know that MSSQL stores datetime values in an internal format,
and client decides how to display them. EM is also a SQL server Client
for server Management. as in your problem you go to following menu in
EM (Enterprize Manager) .

Tool->Options->Connections, check the third checkbox, "Use regional
settings...".

I think it may help you...

for date formate thing also visit see link for :
http://www.dbnest.com/contents.php?cid=63

Cheers.

Saghir Taj
(MCDBA)
DBNest: The Nest of DB Professionals.|||If its OK to use a string with the date formatted into it - look at the
convert function in SQL.

Otherwise dig into the DreamWeaver documentation for date value presentaion
(I can't help you there).

"Gecko" <simon.croome@.solent.ac.uk> wrote in message
news:1112872252.099657.75590@.z14g2000cwz.googlegro ups.com...
>I have a table in SQL Server 2000 with have date/time columns and
> displays the dates as : 1900-01-01 00:00:00.000 which is fine, but when
> I select the column through dreamweaver for an asp page to date is
> shortened to 1900-01-01 but I need to see the whole date / time field
> for conversion purposes.
> Can anyone help ?
> Thanks in advance.