Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databases"JIM.H." <JIMH@discussions.microsoft.com> wrote in message news:27606F13-199E-45F1-9E12- B1232845A907@microso ft.com... > In a stored procedure; > > INSERT INTO myTable(myDate) VALUES (@myDate) > > This inserts data and time, is there any way I can only insert date > portion > of DateTime Is "myDate" field of datetime type or of varchar type? If datetime, all you can do is to "truncate" the date to the midnight: 2005-07-27 21:17:41.123 -> 2005-07-27 00:00:00.000 and you do this so: convert(datetime, substring(convert(va rchar, @myDate, 120), 1, 10), 120) if it is varchar then substring(convert(va rchar, @myDate, 120), 1, 10) Cheers, Wojtek
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread