# Delete\_all multiple conditions

**URL:** <https://www.ruby-forum.com/t/delete-all-multiple-conditions/132194>\
**Category:** Rails\
**Created:** [March 17, 2008, 8:12pm UTC](https://www.ruby-forum.com/t/delete-all-multiple-conditions/132194 "2008-03-17T20:12:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sithadmin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Post date:** [March 17, 2008, 8:12pm UTC](https://www.ruby-forum.com/t/delete-all-multiple-conditions/132194/1 "2008-03-17T20:12:23Z")

</div>

Hello,  
I’m trying to use a delete\_all method to kill some information in my  
database. Where my model is ‘prov’, my code is:

Prov.delete\_all([“created\_at \< ?”, @currenttime],[“bill\_cycle\_date ==  
?”, @cycle\_date])

Basically the equivalent to the SQL statement:

DELETE FROM provs  
WHERE created\_at \< @currenttime AND bill\_cycle\_date = @cycle\_date

However, the first bit doesn’t work and it tells me that it is the  
incorrect number of arguments. Can somebody please clarify how to do  
this?

Thanks,

- Jeff M.

---

<div class="post-metadata">

**Author:** ![sithadmin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Post date:** [March 17, 2008, 8:25pm UTC](https://www.ruby-forum.com/t/delete-all-multiple-conditions/132194/2 "2008-03-17T20:25:23Z")

</div>

nevermind, a buddy helped me out 🙂

Prov.delete\_all([“created\_at \< ? AND prov\_info\_cycle\_end\_date = ?”,  
@currenttime, @cycle\_date])
