Re: [Rails] something strange with sqlite ?

2018-09-18 Thread Hassan Schroeder
On Tue, Sep 18, 2018 at 5:59 AM, Joe Guerra wrote: > todaydate = Time.new > > todaydate = todaydate.year.to_s + "-" + todaydate.month.to_s + "-" + > todaydate.day.to_s > > and the column for enddate is a date type. Aside from the potential problem of redefining the same variable, I'd

Re: [Rails] something strange with sqlite ?

2018-09-18 Thread Joe Guerra
Hi, I defined time like this ---> require 'time' todaydate = Time.new todaydate = todaydate.year.to_s + "-" + todaydate.month.to_s + "-" + todaydate.day.to_s and the column for enddate is a date type. It had worked previously, I just updated the dates in a populate rake file and

Re: [Rails] something strange with sqlite ?

2018-09-17 Thread Hassan Schroeder
On Mon, Sep 17, 2018 at 1:20 PM, Joe Guerra wrote: > I have an active record query (for my categories) that check for the date ( > .where( 'enddate > ?', todaydate )). > > Today's date get's wrapped in quotes, and it fails to produce any records, > but it's perfectly fine in postgres. What

Re: [Rails] something strange with sqlite ?

2018-09-17 Thread Rob Zolkos
doubtful. They are very different. Any reason you can't stick with one of them? On Tue, Sep 18, 2018 at 8:24 AM Joe Guerra wrote: > Thanks, I'll try that. > > Hopefully it works for postgres and sqlite. > > On Mon, Sep 17, 2018, 5:18 PM Rob Zolkos, wrote: > >> I think you will need to wrap

Re: [Rails] something strange with sqlite ?

2018-09-17 Thread Joe Guerra
Thanks, I'll try that. Hopefully it works for postgres and sqlite. On Mon, Sep 17, 2018, 5:18 PM Rob Zolkos, wrote: > I think you will need to wrap todaydate in strftime for sqlite. Away > from computer to check but google ‘date arithmetic sqlite’ > > On Tue, 18 Sep 2018 at 6:20 am, Joe

Re: [Rails] something strange with sqlite ?

2018-09-17 Thread Rob Zolkos
I think you will need to wrap todaydate in strftime for sqlite. Away from computer to check but google ‘date arithmetic sqlite’ On Tue, 18 Sep 2018 at 6:20 am, Joe Guerra wrote: > I have an active record query (for my categories) that check for the date > ( .where( 'enddate > ?', todaydate

[Rails] something strange with sqlite ?

2018-09-17 Thread Joe Guerra
I have an active record query (for my categories) that check for the date ( .where( 'enddate > ?', todaydate )). Today's date get's wrapped in quotes, and it fails to produce any records, but it's perfectly fine in postgres. -- You received this message because you are subscribed to the