Re: I want to collect all records older than 10 days from today from a

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
>
>


.



Relevant Pages

  • Re: Table ID with 4 or more Digits
    ... SQL Server MVP ... > The easiest way to do this is to use an integer column with the ... > starting from 1 and numbering upwards. ... If that is not an option and you must format the column on ...
    (microsoft.public.sqlserver.programming)
  • DCount and Date format Question Against IBM DB2 Date
    ... I have an Access Front-End with IBM Mainframe DB2 backend tables. ... to use DCount to confirm records found. ... The data in the DB2 table is stored in the following format: ...
    (microsoft.public.access.queries)
  • Re: store procedure to write multi lines to txt file
    ... "kriste" wrote in message ... >> Tibor Karaszi, SQL Server MVP ... >> I need to format some data and present it in a user-friendly txt ...
    (microsoft.public.sqlserver.programming)
  • Re: San Performace with SQl Server
    ... If we format The Default cluster size to 64 kb at the Os Level,will it not ... Defragmentation of the Disk,and should we go for a regular defrag of the ... >>> Mike Epprecht, Microsoft SQL Server MVP ...
    (microsoft.public.sqlserver.clustering)
  • Re: Table ID with 4 or more Digits
    ... Format it on SELECT, ... SQL Server MVP ... > orderId column on Northwind has exactly the structure of Id I want my ... The online book has ...
    (microsoft.public.sqlserver.programming)