I would like to know how to get no. of days using getdate() & existing dates in other table, where that table contains multiple records, ie i would like to know the jobs posted 5 days back or 10 days back or 15 days back. I have written the query like
declare @q1 datetime;
select cdate from jobposting where cdate like (select cdate)
select datediff ( dd, q1, getdate())
where q1 must store all the dates in jobposting table, but i cannot get correct answer.
Or i also tried like
select datediff ( dd, select cdate from jobposting, getdate())
thanking U in Advance.