Re: (no subject)
Re: (no subject)
- Subject: Re: (no subject)
- From: Art Isbell <email@hidden>
- Date: Fri, 28 Mar 2003 09:51:14 -1000
On Friday, March 28, 2003, at 08:21 AM, email@hidden
wrote:
I am querying by dates from a SQLserver2000 database. However, I
cannot use
"=" as the @P1 parameter contains an hour in the time part. Can anyone
help?
Qualifying by a timestamp value can be tricky because timestamp data
are frequently stored down to subsecond precision. Therefore, exact
matches using the '=' operator are prone to fail unless you are
absolutely certain that the timestamp data were created with a known
precision (e.g., to the hour only) rather than by storing the current
timestamp down to subsecond precision. If the stored precision is
unknown, then qualification should test for a timestamp range (e.g.,
"date >= timestamp0 and date < timestamp1"). Be careful to avoid the
possible bug of not including a test for equality in no more than one
of the limits (e.g., be careful if you use "date > timestamp0 and date
< timestamp1" or "date >= timestamp0 and date <= timestamp1").
But I am not clear about what you're asking. What do you mean by "@P1
parameter"? Why can't you use '=' with a timestamp that includes an
hour in the time part? If the value's precision is only to the hour,
you can create a timestamp value that's exact to the hour for use in an
equals comparison.
Aloha,
Art
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.