Re: I want to collect all records older than 10 days from today from a
- From: "Jacco Schalkwijk" <jacco.please.reply@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 6 Oct 2005 13:22:25 +0100
select * from mvxbdtm.meslog where meslog.locono=1 and
LORGDT>CONVERT(CHAR(8), GETDATE() -10, 112)
Btw, your code return the data newer than the last 10 days, not older.
--
Jacco Schalkwijk
SQL Server MVP
"Jarkko" <Jarkko@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BFDA0AB7-2583-4D35-826C-52561F083F96@xxxxxxxxxxxxxxxx
>I transform data from a DB2 table to a SQL tabel. The date format in the
>DB2
> is in decimal 10 chr (and we need in taht format since a report generator
> uses that format). But I want to replicate data that is Today-10 days so
> my
> string is:
>
> select * from mvxbdtm.meslog where meslog.locono=1 and LORGDT>20050926
>
> so I need manually change the date every day.
>
> Does someone know how to change from @date to a decimal but this does not
> work:
>
> select * from mvxbdtm.meslog where meslog.locono=1 and LORGDT>@date-10
>
>
.
- Prev by Date: Re: Install and uninstall DTS package using a script
- Next by Date: Re: Importing a 'Date' field via DTS Package
- Previous by thread: Install and uninstall DTS package using a script
- Next by thread: Re: Missing: hour/minute / second data (smalldatetime)
- Index(es):
Relevant Pages
|