If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Date Range Search Problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-29-03, 03:50
donaldt donaldt is offline
Registered User
 
Join Date: Jan 2002
Location: Nottingham - UK
Posts: 113
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
Reply With Quote
  #2 (permalink)  
Old 08-06-03, 09:09
dbadelphes dbadelphes is offline
Registered User
 
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.

Quote:
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On