"display only date in dd/MM/YYYY format"
this is a presentation concern, not query concern. you can present the
date however you like to the user using formatting.

On Oct 28, 3:45 am, Oskar Berggren <[email protected]> wrote:
> Inline.
>
> 2009/10/28 Hiren <[email protected]>:
>
>
>
> > at the time of query upload,
>
> I'm not sure what you mean here. My first interpretation of "query
> upload" is "when query is sent to sql server", but your query string
> does not contain a date value sent to the sql server.So I assume you
> mean, "when data comes back from sql server".
>
> > query is returning rows with date field along with time, I want to
> > remove time part and display only date in dd/MM/YYYY format.
>
> This does not necessarily have anything to do with HQL. You are
> getting back Datetime instances.To format to the output string you
> want in your user interface, use ToString(formatcode) on the Datetime
> instance with the proper locale settings and format code.
> ToString("dd/MM/yyyy") is a start if you don't want to be sensitive to
> locale settings.
>
> If the returned data is passing the boundary of some service interface
> before reaching the user interface, and you have a business
> requirement to only have date for this info, transform the Datetime
> instances returned from NHibernate using zerotimeDatetime =
> oldDatetime.Date in the service before returning them. The user
> interface will use the same formatting code as above.
>
> /Oskar
>
>
>
> > On Oct 24, 7:29 am, Fabio Maulo <[email protected]> wrote:
> >> only in query upload or even when you save the obj ?
>
> >> 2009/10/23 Hiren <[email protected]>
>
> >> > Dear Friends,
> >> > We are developing application using VS2008, c#, SQL Server2000 and
> >> > Nhibernate.
>
> >> > HQL query "select a.empname,a.joiningdate from entemp a"
>
> >> > here date of joining is coming along with time.
> >> > I want to remove time part in query, could you pls help me.
>
> >> > thanks in advance
> >> > hiren patel
>
> >> --
> >> 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