sql - Performing an Update query with a date -
can perform update query checking value of date whether date entered greater date stored in database.
if @input_date > table.date update table set table.value = 0, table.date = @input_date else update table set table.value = @input_value, table.date = @input_date
use case statement
try this
update table set table.value = case when @input_date > table.date 0 else @input_value end, table.date = @input_date
Comments
Post a Comment