tenderfoot
Registered User.
- Local time
- Today, 17:15
- Joined
- Dec 1, 2007
- Messages
- 10
Hello there,
I have been bashing my head off of my laptop trying to get a query to return records where a date field is between two dates.
1. The field has a datatype of date/time
2. There are only two records in the database where the field Client.Refdate of record one is equal to 05/12/2007 and record two is equal to 05/01/2008.
3. The SQL was like this:
However when I ran the query no results are returned.
I searched the forums and found this post: http://www.access-programmers.co.uk/forums/showthread.php?t=139619&highlight=dates
So amended the sql like so but to no avail:
Can anyone point out my error, or any potential things I have missed...I am going bonkers!
tenderfoot
I have been bashing my head off of my laptop trying to get a query to return records where a date field is between two dates.
1. The field has a datatype of date/time
2. There are only two records in the database where the field Client.Refdate of record one is equal to 05/12/2007 and record two is equal to 05/01/2008.
3. The SQL was like this:
Code:
SELECT Client.clientMarital, Client.clientFirstname, Client.clientMiddlename, Client.clientSurname, Client.clientGender, Client.clientAddress1, Client.clientPostcode, Client.clientRefdate
FROM Client
WHERE (((Client.clientRefdate)>(#04/12/2007#) And (Client.clientRefdate)<(#06/12/2007#)));
However when I ran the query no results are returned.
I searched the forums and found this post: http://www.access-programmers.co.uk/forums/showthread.php?t=139619&highlight=dates
So amended the sql like so but to no avail:
Code:
SELECT Client.clientMarital, Client.clientFirstname, Client.clientMiddlename, Client.clientSurname, Client.clientGender, Client.clientAddress1, Client.clientPostcode, Client.clientRefdate
FROM Client
WHERE (((Client.clientRefdate)>DateAdd("d",1,#04/12/2007#) And (Client.clientRefdate)<DateAdd("d",1,([Client].[clientRefdate])<#06/12/2007#)));
Can anyone point out my error, or any potential things I have missed...I am going bonkers!
tenderfoot