| Author: Srinivasulu 01 Oct 2008 | Member Level: Bronze | Rating:  Points: 2 |
You can take the field as DateTime and when you query on it use convert function to retrieve the time part or date pat of column.
|
| Author: elango 01 Oct 2008 | Member Level: Bronze | Rating:  Points: 2 |
There are some pre defined methods offered for datetime variable in dotnet like ToLongDateString (),ToLongTimeString (),ToShortDateString (),ToShortTimeString (),etc so u can use ToShortTimeString () and then u can store that datetime varible to the time field.
|
| Author: maheswari 01 Oct 2008 | Member Level: Bronze | Rating:   Points: 3 |
create table tbexample(name varchar(50),time datetime,date datetime) after that you create storeprocedure.procedure like this create procedure spinsertexample @name varchar(50) as begin insert into (name,time,date) values(@name,RIGHT(CONVERT(VARCHAR(19),GetDate(),120),8),convert(varchar(50),getdate(),103)) you execute this store procedure.output like this Name Time Date Abcd 10.00 12-04-08 asd 12.00 14-05-08
|