mardi 13 octobre 2020

check if date appear in a table, and if so print some table SQL

in need to check if today appear in some dates table and if so, to print a table (in a job running every day) i must use IF.

here is what i try - but it is not working: because in table time there is more then 1 value. i also try use EXISTS but it doesn't work too.

IF GETDATE()  = (
select date
from Time 
where day_by_OF = 2
)

 
begin 
exec sp_run_update;
end

Aucun commentaire:

Enregistrer un commentaire