MS Access

Panda On Smack

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,030
Got the following Query which i initially used in SQL an have adapted it slightly to work on Access

SELECT EDate FROM Table WHERE (Authed = 1 AND DATEPART('m', Date()) = 9 AND DATEPART('yyyy', Date()) = 2005) Order By EDate

In my table i have a Date field and for testing purposes i have 2 entries in the table with a date from this month and a date from next month

05/09/2005
08/10/2005

The above query should only select the date from this month but it selects both, any clues as to why?

Interestingly im running the query in asp which returns the results but if put the SQL in the Query window of Access it doesnt return anything?

Ta
 

Panda On Smack

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,030
Ok im a chump, at first i had named my field Date which was silly as thats the name of the function in Access/SQL so instead of parting the date i had stored it was parting the current Date()

Query should be

SELECT EDate FROM Table WHERE (Authed = 1 AND DATEPART('m', EDate) = 9 AND DATEPART('yyyy', EDate) = 2005) Order By EDate
 

Users who are viewing this thread

Top Bottom