Need help with Excel Microsoft Query

  • Thread starter Thread starter erick-flores
  • Start date Start date
E

erick-flores

Hello all

I want to add a field to my query based on another field. The "another
field" is a date field (field_date).

What I want to do is: IF(field_date >=01/01/00 and <=12/31/00, "2000",
0)

I want to get the year by itself based on the field_date, perhaps
there are another ways of doing this?

But obviously i am missing something or doing something wrong, because
when I tried to run the query i get the Sysntax error.

Thanks in advance
 
hi,
If it is just a formula you want to add, don't need to add it to the query.
right click any tool bar and click customize at the bottom. click the
toolbar tab.
check external data. close the customize box. on the external data toobar,
click
data range properties. in the properties box, at the bottom, check fill down
formulas in columns adjacent to data. close the properties box.
put your formula in the column right of the query. assuming your date field
is in column A and you have a header row.....
=IF(AND(A2>=01/01/00,A2<=12/31/00),2000,0)
copy down.
with the fill down check in the query properties, xl will add and remove the
formula in the column as needed, depending on how much data it brings back.

hope this helped,
regards
FSt1
 
Back
Top