Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sql_user1
Starting Member
1 Post |
Posted - 2011-06-13 : 11:46:03
|
i need to select some data that the enddate is = to todays date and 30 days ahead at any one time. What query would I need for this. The sql I have is below.SELECT column a,surname,enddate from table cinner join table p on c.column=p.columnTypeinner join event eon c.columnid=e.columnid where e.typeid=1 and group by c.columnid, column a, column bMany thanks in advance. |
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-06-13 : 11:59:38
|
and enddate between GETDATE() and GETDATE()+30 or maybe and enddate between dateadd(dd,datediff,dd,0,GETDATE()),0) and dateadd(dd,datediff,dd,0,GETDATE()),0)+30==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|