Nick Els

Nick Els

  • NA
  • 16
  • 664

SQL Server date format.

Oct 16 2017 7:42 AM
Thank you. I'm very new to this - I've a small program to start off with in which I'm adding records with 4 textboxes and a datapicker1 control on a Windows form. I'm not managing to get the SQL server databse to except my date format ie. "dd/mm/yyyy" - it insist I enter the date as YYYY-MM-DD
 
The databse is field for the date is set as DATE - I've tried adding a DEFAULT GETDATE() & also tried SYSTEM() for the field in design view, but to no avail.
 
CREATE TABLE [dbo].[PhoneIndex] (
[phoneId] INT IDENTITY (1, 1) NOT NULL,
[fName] VARCHAR (50) NOT NULL,
[lName] VARCHAR (50) NOT NULL,
[datePhoned] DATE NOT NULL DEFAULT GETDATE(),
[reaSon] VARCHAR (250) NOT NULL,
[PhoneNumber] NCHAR(15) NULL,
CONSTRAINT [PK_PhoneIndex] PRIMARY KEY CLUSTERED ([phoneId] ASC)
);
 
 Source code attached ZIP file.
 
Thank you so much.
 
Nick. 
 

Attachment: CallsMain.zip

Answers (2)