> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Jeremy Coulter
> Sent: Sunday, 3 October 1999 10:44
> To: Multiple recipients of list database
> Subject: RE: [DUG-DB]: [WARNING]: Converting TDateTimePicker.Date to
> ftDate TQuery Parameter
>
>
> Patrick Wrote :-
>
> > I discovered that using a range of only one day, records with
> the date of
> > that day were not selected but if the range was extended a day in one
> > direction, then records would be selected.
>
> Yes I have discovered this before myself.
> It SEEMS to be something that spans Most products and Db's.
>
> I first spotted this in Delphi, but have also noticed it in Vb at work.
> I basically don't use TParams but build the SQL in code, and add
> the params
> as needed.
>
> I.e. 'WHERE NAME = "'+fName+'" And '.......
>
> with Dates, I check to see if the dates selected are the same and
> used to do
> this :-
>
>  if fDateFrom = fDateTo then
>   SQL:='WHERE Date = #'+fDateTo+'#'
>  else
>   SQL:='WHERE date between #'+fDateFrom+'#' AND #'+fDateto+'#'
>
> Or atleast some thing like this from memory.
>
> BUT, from what I have found, basically if you use DATETIME fields in a
> database, it stores the TIME as well as the DATE....so I have now started
> using the BETWEEN syntax and appending 00:00:00 to the From date , and
> 23:59:59 to the TO date.
> I have found this to be the pref. way as it spans a day OVER a
> literal day.

I'd say this is a bigger problem with Access because it doesn't have a
separate DATE type, there is only one field type for DATE/TIME.

snip

============================================
Patrick Dunford, Christchurch, NZ
http://patrick.dunford.com/

---------------------------------------------------------------------------
  New Zealand Delphi Users group - Database List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to