DateTime Problem
-
hi i have a problem here i have a column in database the data type is DateTime i insert into this column Time only LIKE " 09 : 00 AM " but after i insert data it stores in table date with the time i entered the problem is i want to select the data from this column as Time Only i try this select convert(smalldatetime ,ExamTime,108) but i back by the date also how can solve my problem thnx 4 help
MD_NADA
-
hi i have a problem here i have a column in database the data type is DateTime i insert into this column Time only LIKE " 09 : 00 AM " but after i insert data it stores in table date with the time i entered the problem is i want to select the data from this column as Time Only i try this select convert(smalldatetime ,ExamTime,108) but i back by the date also how can solve my problem thnx 4 help
MD_NADA
-
hi i have a problem here i have a column in database the data type is DateTime i insert into this column Time only LIKE " 09 : 00 AM " but after i insert data it stores in table date with the time i entered the problem is i want to select the data from this column as Time Only i try this select convert(smalldatetime ,ExamTime,108) but i back by the date also how can solve my problem thnx 4 help
MD_NADA
Another option would be to store the time as a number, and when you retrieve it from your database, you can format it in your own way. For example, I store time fields as 6 digit numbers. The first two digits for the hour (military time) the second two digits as minutes, and the last two digits as seconds. So when I store them to my data base I only have to take the datetime object and do this: myDataBaseRow("myTimeColumn") = objDateTime.ToString("HHmmss") I know this isn't what you asked for, but I thought another view point might be helpful.
-