let's assume that we create a transaction table using the SQl server management studio
txn_id int, txn_type_id varchar(200), Account_id int, Amount int, tDate date );
with the date data type, we can insert the values ββin a simple format: 'yyyy-mm-dd'
INSERT INTO transactions (txn_id,txn_type_id,Account_id,Amount,tDate) VALUES (978, 'DBT', 103, 100, '2004-01-22');
Moreover, we can have different time formats, such as.
DATE - format YYYY-MM-DD DATETIME - format: YYYY-MM-DD HH:MI:SS SMALLDATETIME - format: YYYY-MM-DD HH:MI:SS
Zia Ullah
source share