Re: Finding the Shift for current hour
- From: Hugo Kornelis <hugo@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 07 Nov 2005 23:44:07 +0100
On Mon, 7 Nov 2005 05:21:02 -0800, Pradeep TN wrote:
>Hi Hugo Kornelis,
>
>Thank you very much for your reply. The query is working fine. However, I
>had to make one change in my data since the query failed on one condition.
>Since I was only interested in "time" part, I had not looked properly into
>the "date" part. When I insert rows for the given shift information, the
>"date" part defaults to '1899-12-30'. I am not sure why this is so, since the
>base date is supposed to be '1900-01-01'.
Hi Pradeep,
Are you using Enterprise Manager to isnert the data? For some mysterious
reason, the deveopers who wrote EM seem not to have tallked to the
developers who wrote the core data handling of SQL Server - instead of
asking them for the default date, they chose their own. 1899-12-30, as
you might have guessed.
>If you look at Shift B, it starts from 6 PM - 6AM. Now if '1899-12-30' is
>supposed to be by "base date" for this table, 6 AM represents 6 AM of
>'1899-12-31'. So made that change in the table and your query is working
>fine. Before this change, if my @EventMoment was '18:10:00', there were no
>rows returned.
Yeah, my query assumed that the times were stored with the correct
default date. Glad you were able to sort this last problem out by
yourself!
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)
.
- References:
- Re: Finding the Shift for current hour
- From: Hugo Kornelis
- Re: Finding the Shift for current hour
- From: Pradeep TN
- Re: Finding the Shift for current hour
- Prev by Date: Re: Finding the Shift for current hour
- Next by Date: Re: Max
- Previous by thread: Re: Finding the Shift for current hour
- Next by thread: Re: Max
- Index(es):
Relevant Pages
|
|