If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Problem with Dates in Query
I have a field with dates. However, I need to separate only the year in
another column. This is what I have so far but it is not working. Year: IIF([mydatefield] = #m/d/2009#,#2009#,IIf([mydatefield]=#m/d/2010#,#2010#)). Can somone please help me with this? Thank you. |
#2
|
|||
|
|||
Problem with Dates in Query
TotallyConfused wrote:
I have a field with dates. However, I need to separate only the year in another column. This is what I have so far but it is not working. Year: IIF([mydatefield] = #m/d/2009#,#2009#,IIf([mydatefield]=#m/d/2010#,#2010#)). How about: MyYearField: Year(mydatefield) Note: It is a very bad practice to use a reserved word such as Year as something you created. -- Marsh MVP [MS Access] |
Thread Tools | |
Display Modes | |
|
|