Groups | Blog | Home
all groups > sql server programming > april 2004 >

sql server programming : Updating data based on timestamp


ajmiester
4/12/2004 7:01:50 PM
Hi

I have a table that has data being inserted as soon as it available. I have
a query that is scheduled to run at the end of the day which extracts data
where date > yesterday. I have to modify it to run every half hour and only
include data that was inserted after the previous run.

Create table tmp_comp
( name char(30),
number float,
flag char(2),
e_dt datetime
)

current query

declare @y_dt char(12)
select @y_dt = convert(char(12),(select dateadd(dd, -1, getdate())),10)
--print @y_dt

select name as C_name,
number as Value,
e_dt as Entry_date
from tmp_comp
where convert(char(12),e_dt,10) = @y_dt
order by name
go

Ajay

ajmister
4/13/2004 12:21:25 PM
Sorry about that.
Ajay
[quoted text, click to view]

Andrew John
4/13/2004 2:03:06 PM
Please do not repeat post - netiquette.

[quoted text, click to view]

AddThis Social Bookmark Button