Hi,
we have many functions in DB like
1. GETDATE() --> gets you the current date and time
2. DatePart() --> Returns int type i.e., time, date, smalldatetime, datetime, datetime2, or datetimeoffset value etc.,
3. DateDiff() the difference of two dates --> result can be drawn in minutes, hours, days etc
To Insert Date into Database,
Suppose you have a table(Demo) with column TodayDate(Name) DateTime or Date (datatype).
Query: Insert INTO Demo(TodayDate) values (GetDate()) gets you the current date time and inserts into the table.
Regards,
Awesome Coding !! :)
Gow.Net, if this helps please login to Mark As Answer. | Alert Moderator