# Select date... date

**URL:** <https://www.ruby-forum.com/t/select-date-date/84108>\
**Category:** Rails\
**Created:** [February 1, 2007, 2:18pm UTC](https://www.ruby-forum.com/t/select-date-date/84108 "2007-02-01T14:18:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chika](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9dc877/32.png) [@Chika](https://www.ruby-forum.com/u/Chika)\
**Post date:** [February 1, 2007, 2:18pm UTC](https://www.ruby-forum.com/t/select-date-date/84108/1 "2007-02-01T14:18:02Z")

</div>

I still have problems with dates. 2 of them this time.the first is that  
I have 2 date\_select for the users to select a period for a report, but  
when I try to read them in the controller I get a nil error… but they  
are not nil…wierd.

- rhtml:

**Desde** \<%= date\_select('reporte', 'inicio',:order =\> [:day, :month, :year])%\> **Hasta** \<%= date\_select('reporte', 'termino',:order =\> [:day, :month, :year])%\>
- controller:  
string = ‘usuario\_id = ‘+ @usuario.id.to\_s  
string+= ’ AND tipo in ’ + array\_to\_string(@tipo,’,’)  
string+=‘AND created\_at \>’ +(params[:reporte][:inicio])  
string+=‘AND created\_at \<’ +(params[:reporte][:termino])  
string+='ORDER BY '+@orderempresa

and the error:

can’t convert nil into String  
Parameters: {“commit”=\>“Generar Reporte”,  
“reporte”=\>{“inicio(1i)”=\>“2007”, “inicio(2i)”=\>“1”, “inicio(3i)”=\>“1”,  
“termino(1i)”=\>“2007”, “termino(2i)”=\>“1”, “termino(3i)”=\>“31”,  
“orden”=\>“operacion”}, “usuario”=\>“9”,  
“operaciones”=\>{“creaciones”=\>“true”, “eliminaciones”=\>“true”,  
“modificaciones”=\>“true”}}

As you can see it’s not nil… Â¿anybody knows why this happens?  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
The second problem is that I getting a year (of studies) without any  
problem, but when I show the information, it doesn’t show the recorded  
year, it shows 2007.

The select is in the rhtml as follows:

\<% @persona.estudios.each do |@e|%\>

  
**Grado:** \<%= text\_field (‘e[]’,‘grado’)%\>  
**Institucion:** \<%= text\_field  
(‘e[]’,‘institucion’) %\>  
**Año:**  
\<%= select\_year(Date.today, :start\_year =\> 1950,  
:field\_name=\>‘ano’)%\>  
  
and nothing, it doesn’t show error or anything just a wrong year.  
Any thoughts?

Muchas gracias!!!
