-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ning ha scritto: > Hi all, > > Anyone have any ideal how to search a particular hour. > > usually we can use datepart function in sql. > > for example > > datepart(hour, datetime) in (7,8) > > But it is not really working in sqlalchemy > > I tried > > func.datepart(func.hour, xx.c.datetime)._in((7,8)) >
This is not the correct syntax. http://www.postgresql.org/docs/8.3/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT func.datepart('hour', xxx.c.datetime) Manlio -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkt9PWsACgkQscQJ24LbaUSZDACfVErbMbOGAxdles+PSfyt1MFi cnIAoJT5gz3aM6/HGATkakEczmgQ3B+L =lWFS -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.