I have a table with an index value, date,time and a text field. There are constraints on the date and time fields. The constraints are:
DATE1 - ((datepart(hour,[DATE1]) = 0 and datepart(minute,[DATE1]) = 0 and datepart(second,[DATE1]) = 0 and datepart(millisecond,[DATE1]) = 0))
so the date must be like 20210812 00:00:00.000
TIME1 - ((datepart(day,[TIME1]) = 1 and datepart(month,[TIME1]) = 1 and datepart(year,[TIME1]) = 1900))
and the time must be like 19000101 08:23:50.010
What is the proper way to construct this insert statement? I will have values for index and text and can use GETDATE() but how do I format GETDATE()?
Our community of experts have been thoroughly vetted for their expertise and industry experience.