Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Sep 2007
    Posts
    179
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Question delete all fields that...

    mysql=select dtimes from table1 where dtimes <" &dateadd("n",-20,now())

    is it possiable to delete all the fileds that are less than 20 with sql
    or i got to use

    Do While Not rstemp.EOF
    rstemp("dtimes")=""
    rstemp.movenext
    loop

    ?
    By the time u recognize this moment, This moment will be gone.

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    Huh?

    You want to find all the records where dtimes is less than (ie: previous to) the time 20 minutes ago, and set the value of dtimes for those records to be empty?

    mySQL = "UPDATE table1 SET dtimes = '' WHERE dtimes < " & dateadd("n",-20,now())

  • #3
    Regular Coder
    Join Date
    Sep 2007
    Posts
    179
    Thanks
    4
    Thanked 0 Times in 0 Posts
    i got 2 tables...on the table "times" i only null the records column "dtime" (if it is not null) and save this records column "username"... straight after that i need to select on the second table "useringo" the record with the same username that its time was nulled and to null its column "msginfo"

    deperatly need you suggestion to how to do this...i do not want to run on all this tables every time...i want it be most minimal and smart
    By the time u recognize this moment, This moment will be gone.

  • #4
    Regular Coder
    Join Date
    Sep 2007
    Posts
    120
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Post DDL. Why should we guess how your databse looks like.

    Tom


  •  

    Posting Permissions

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