sql server data types date

sql server data types date


sql server data types date
SQL Data Type: DATE doesn't appear the way I want?

Hi, I'm a super new to SQL.
I'm using ERWin to create a relationship of each table and did forward engineering to generate tables onto 2005 SQL Server.

I set data type for date (shipping date, order date, etc..) with DATA. I was hoping them to appear as MM/DD/YYYY on SQL Server, however, when see it, it sows as 1900-01-01- 00:00:00.000.

When I did INSERT command, I entered date data , for example, 5/29/2009.

Please help what I did wrong!

Thank you.

Hello, a date field in SQL is by default a date and time serial number (for formatting of the date does not matter). Your insert command is probably inserting the mathematical formula 5 divided by 29 divided by 2009. You need to enclose the date in single quotes and SQL will interpret that it is a date.

[phpzon]sql server data types date, 5, Electronics[/phpzon]
[phpbay]sql server data types date, 30, "11211"[/phpbay]

SQL 054 Data Types, Date Time Timestamp Data, TIME

Leave a Reply