Using SQL Server 2000
dtptime - datetimepicker (Format: Custom Format(HH:mm)
Query
insert into table1 values (Convert(varchar(8), '" & dtptime & "', 108))
The above query is inserting a datevalue instead of time. I want to insert a time value only.
When i use a current date (getdate()) means it is inserting correctly, but from datetimepicker it is getting only date, not a time.
How to get only a time.
Need query Help
To insert time only, use the code below:
You may see it in action here: https://data.stackexchange.com/stackoverflow/q/117721/
Additional Information:
Take a look at MSDN list of conversion codes.
When inserting a time-only value into a
datetimefield, the date will default to01-01-1900