hi I have Date table in database
Id
Year
Month
day
I want when users click on button in DAte tabel in year column save Current Year in Month Column save Current Month and in Day column save current day
I used GETDATE() function before but it save whole date in 1 column I want it save Year-Month-day in seprate Column How I can do it?
Best Regards
Neda
You can easily extract Year, Month and Day from GETDATE()
INSERT INTO TBL VALUES(1, DATEPART(YEAR, GETDATE()), DATEPART(MONTH, GETDATE()), DATEPART(DAY, GETDATE()))
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.