Hello Dears!
i m working with windows Datetimepicker control i have to save the Starttime and Endtime for a scheduled shift.From front end i did it right by setting the following properties of Datetimepicker Format=Custom and Custom=hh:mm tt but when i save this time in the Sql data base it is saved with complete date and time (In sql i m savind it as DateTime datatype)and when i retrieve it in a list view from database in start and end time Date is also mentioned that i dont want. Is there any way to display or save only the Time irregard of its Date.
Thnx in advace!
Sohail IqbalPosted Dec 23, 2005, 9:28 AM
You can use one of the following options:
1) What you can do is store time as string of characters using "nvarchar".
2) Define new type with underlying type as "nvarchar" and name it as "Time", length should be five, rule none and default none.
3) Format the same date which is stored in database using date functions in select statement, e.g DATEPART(dw,date).
4) Format the date in front end it self which is more easy and flexible way of doing it and then display it.
cheers.