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?
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?
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)
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)
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.
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))