well, with client side filtering i got it working, but it is far from ideal
due to the high number of records.
there are some interesting edge cases there (at least on the .net side):
- december 15th should also include dates until january 15th
- people with date of birth of 29/02/1972 might have to advance until
1/3/{thisOrNextYear}I wonder if that's possible at all to account of in the query... On Mon, Mar 22, 2010 at 8:33 PM, Paul Hinett <[email protected]>wrote: > Ah sorry I didn’t realise this, is it working for me because I am using > SQL Server as my database? > > > > Paul > > > > *From:* [email protected] [mailto:[email protected]] *On > Behalf Of *Fabio Maulo > *Sent:* 22 March 2010 23:26 > *To:* [email protected] > *Subject:* Re: [nhusers] query on dates > > > > Paul your query can't work because is not a HQL and because you are using > some reserved words (reserved in HQL). > > 2010/3/22 Paul Hinett <[email protected]> > > Hi, > > > > I done something similar with a query. > > > > var query = Session.CreateQuery("from Account a where " + > > "datepart(dayofyear, a.Dob) between > datepart(dayofyear,getdate()) and datepart(dayofyear, > dateadd(day,:numdays,getdate()))" + > > "select a") > > .SetInt32("numdays", numDaysInFuture) > > .List<Account>() > > .OrderBy(x => x.Dob.Value.DayOfYear).ToList(); > > > > Hope this helps. > > > > Paul > > > > *From:* [email protected] [mailto:[email protected]] *On > Behalf Of *Jan Limpens > *Sent:* 22 March 2010 21:16 > *To:* nhusers > *Subject:* [nhusers] query on dates > > > > hello > > I have an entity User > > class User{ > string Name; > DateTime Birthday; > } > > how can I query for all Users that have birthday within the next 30 days? > > -- > Jan > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 9.0.791 / Virus Database: 271.1.1/2759 - Release Date: 03/22/10 > 07:33:00 > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > > > > -- > Fabio Maulo > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 9.0.791 / Virus Database: 271.1.1/2759 - Release Date: 03/22/10 > 07:33:00 > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > -- Jan -- You received this message because you are subscribed to the Google Groups "nhusers" group. 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/nhusers?hl=en.
