![]() |
|
|
#1
|
|||
|
|||
|
I'm trying to do a query to pull out data between 02/28/**** and 11/15/**** . Each time I put this in the query I getting a mix match data error. Is there a way better way to code this?
|
|
#2
|
|||
|
|||
|
Something like this would work:
SELECT <some fields> FROM <some table> WHERE DateField BETWEEN DateSerial(Year(DateField), 2, 28) AND DateSerial(Year(DateField), 11, 15) |
|
#3
|
|||
|
|||
|
OK, the editor turned eight-parenthesis to a smiley!
SELECT <some fields> FROM <some table> WHERE DateField BETWEEN DateSerial(Year(DateField), 2, 28 ) AND DateSerial(Year(DateField), 11, 15) |
|
#4
|
|||
|
|||
|
This is good,but I didn't get the results I was expecting and that was my fault. I should had said that I only want the data between 11/15**** and 02?23****. Therefore I shouldn't see any data before 11/15 of any year and nothing after 02/28 for any year. When coding what you sent me I'm getting dates showing for the month of 03, 04, 05, etc...
Here is the code I used; Between DateSerial(Year([reportingdate]),11,15) And DateSerial(Year([reportingdate]),2,28) Even if I switch the dates around I get the same results. |
|
#5
|
|||
|
|||
|
gemini,
The problem is that you are not using a between. SELECT <some fields> FROM <some table> WHERE (DateField <= DateSerial(Year(DateField), 2, 28 )) OR (DateField >= DateSerial(Year(DateField), 11, 15)) |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Changing a date to the current year | fdnyfish | Access | 1 | 03-01-2008 05:34 AM |
| Finding data that doesn't match | dlhayes | Queries | 1 | 11-11-2006 05:14 PM |
| Retrieving Week of Year in a date range | Korvega | Queries | 2 | 05-27-2006 04:29 AM |
| How to report data in fical year order | gemini2 | Reports | 1 | 05-27-2006 04:26 AM |
Make sure end date is one year greater than start date
|
AimeeK | Forms | 1 | 12-09-2005 07:29 PM |