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].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to