EXTRACT function not supported in Access?

M

Marshal

I need to use the EXTRACT function in a select statement
but Access 2000 doesn't seem to recognize it.

SELECT EXTRACT(YEAR FROM Date_Signed) AS FY FROM
SBIRs_Actions

I get the error:
"Syntax error (missing operator) in querry
expression 'EXTRACT(YEAR FROM Date_Signed)'

Does Access just not support the EXTRACT function or am I
missing something. If it doesn't support it, is there a
similar function I can use.

EXTRACT Function:
"Returns one field from a date value.

EXTRACT(extract_field FROM column_reference)

Description

Use EXTRACT to return the year, month, or day field from
a DATE or TIMESTAMP column. If the column used with the
EXTRACT function contains a NULL value, the return value
of EXTRACT will be NULL. If the value is not NULL,
EXTRACT returns the value for the specified element in
the date, expressed as a SMALLINT."

Thanks for the help
 
J

Jen

Hi,

So, if I understand correctly, you're trying to extract
the year from a date/time field? If so, then use the
DatePart() function.

SELECT.... DatePart("YYYY", Date_Signed) as FY FROM....

Regards,
Jen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top