On Monday, September 10, 2012 2:23:50 PM UTC-7, abhijit wrote:
>
> Jeremy, I had tried that earlier. My output comes out like this -
>
> --- 
> - :count: 5
>   :"CAST(strftime('%Y', `start`) AS INTEGER)": 
>
> Have the DateTimes not got inserted correctly into the table in my case?
>
>
You probably want to alias the result in that case:

  db[:timesheets].group_and_count(Sequel.extract(:year, 
:start).as(:start_year)).all.to_yaml

In the future it would be easier if you figure out what SQL you want to 
generate first, and then ask how do generate that SQL.  If you don't know 
what SQL you want to generate, you should probably consult a general SQL 
reference. I'm happy to help people with general SQL issues, but only if it 
appears they are willing to do some work themselves.  Posting on IRC, Stack 
Overflow, and the Google Group with the same basic questions that can be 
answered by reading the available documentation leads me to believe that is 
not the case for you.

Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sequel-talk/-/CPwJVhbcNZ8J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to