That's hard to say without knowing how your dates are stored
or what you need to do with the time portion and how that
needs to be handled. But DateAdd is what you would need to
do. Something along the lines of:
select *
from YourTable
where DateColumn = Dateadd(dd, -1, cast(convert(varchar(10),
GetDate(), 101) as Datetime))
-Sue
On Tue, 1 Feb 2005 08:33:04 -0800, "Billy"
<Billy (AT) discussions (DOT) microsoft.com> wrote:
Quote:
I have a DTS package, part of which does this:_
select * from database.tablename where ididat = 20050130
What I would like to do is replace the fixed date with a dynamic date, so I
don't have to edit it. I've tried combinations of DateAdd and GetDate() etc,
but to no avail.
I just can't get it to work. Badically, it needs to return the data from the
previous day.
Any help would be greatly appreciated.
Thx
Billy |