Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2002
    Location
    Nottingham - UK
    Posts
    113

    Unanswered: Date Range Search Problem

    Hi

    I am trying to query a date range on a single datedate field in sql 2000 db - the query below will not work if I do a search on say 21/07/2003 to the 21/07/2003, although there are records on for that day.

    Can anyone help ??

    SELECT *
    FROM dbo.WA
    WHERE ((([wa].date)>='start')) AND ((([wa].date)<='finish'));

    Thanks

  2. #2
    Join Date
    Feb 2003
    Location
    Montreal, Canada
    Posts
    117

    Re: Date Range Search Problem

    1.Is wa.date a datetime/smalldatetime field?
    2.How dates are represented in your table: dd/mm/yyyy or mm/dd/yyyy? Maybe you should consider a cast (see cast and convert in SQL Books Online) in the WHERE clause.

    Originally posted by donaldt
    Hi

    I am trying to query a date range on a single datedate field in sql 2000 db - the query below will not work if I do a search on say 21/07/2003 to the 21/07/2003, although there are records on for that day.

    Can anyone help ??

    SELECT *
    FROM dbo.WA
    WHERE ((([wa].date)>='start')) AND ((([wa].date)<='finish'));

    Thanks
    Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •