Can you insert current date via a function with an insert statement?
Should look something like this:
insert into table name
values
(getdate(), getdate()-1)
,(getdate(), getdate()-1)
The above example may be vague but can this concept be done?
Can you insert current date via a function with an insert statement?
Should look something like this:
insert into table name
values
(getdate(), getdate()-1)
,(getdate(), getdate()-1)
The above example may be vague but can this concept be done?
In a word - yes. You can use the results of function calls or calculations as arguments to a values
clause of an insert
statement.
Yes you can manipulate function directly
SELECT GETDATE()-1
But I will Suggets use DATEADD
function
SELECT DATEADD(D,-1,GETDATE())