Results 1 to 3 of 3

Thread: Query mdb

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    Netherlands
    Posts
    128
    I need to delete old data from a *.mdb file.

    In the database there is a column with the timestamp of the logged data.

    I need a Query to delete the data from 15-3-00.




    ID ProductNr TimeStamp ProductName
    88 1 15-3-00 17:50:51 Test1
    89 1 15-3-00 17:51:51 Test1
    90 2 15-3-00 17:52:50 Test2
    91 2 15-3-00 17:53:51 Test2
    92 2 15-3-00 17:54:50 Test2
    93 2 15-3-00 17:55:51 Test2
    94 2 16-3-00 9:18:13 Test2
    95 2 16-3-00 9:19:12 Test2
    96 3 16-3-00 9:20:12 Test3
    97 3 16-3-00 9:21:12 Test3
    98 1 16-3-00 9:22:13 Test1

    Thanx
    Remember Programmers don't sleep

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845


    Use to Like operator

    DELETE * FROM TableName WHERE TimeStamp Like '15-03-00*';
    Mark
    -------------------

  3. #3
    Addicted Member
    Join Date
    Oct 1999
    Location
    Oporto, Portugal
    Posts
    134

    Remark

    Just a remark.

    You can use smaller than (<) to delete the data from the date (and bellow):

    DELETE * FROM TableName WHERE TimeStamp Like <= '15-03-00*';

    This example erases all data smaller and equal to 15-03-00.
    Jorge Ledo
    [email protected]
    Portugal were the sun allways shine... for programmers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width